Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Visual Basic: DataGrid Control

Visual Studio 6.0

CellText Method

See Also   Example   Applies To

Returns a formatted text value from a DataGrid control cell. Doesn't support named arguments.

Syntax

object.CellText bookmark

The CellText method syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
bookmark Required. A string expression that represents a row in the DataGrid control.

Remarks

The CellText method returns a formatted string representation of the data in the current column for the row specified by the bookmark value. Using the CellText method is similar to accessing the Text property, except you can select a specific row from which to retrieve the value.

The value returned by the CellText method is derived from the Text property by applying the formatting as specified by the NumberFormat property of the Column object.

When using the CellText method, use the Columns collection to specify the specific column of the DataGrid control and set the bookmark argument to a specific row.

Using the CellText method to extract information from a cell doesn't affect the current selection.

Show:
© 2015 Microsoft