Obtain and Set Cell Values in Code
- 2 minutes to read
You can use the GridControl‘s methods to obtain and modify cell values.
Refer to Obtaining Row Handles and Accessing and Identifying Columns for information on how to obtain row handles and identify columns.
Obtain Cell Values
Method | Description |
---|---|
Returns the value of the specified cell. | |
Returns the value of the specified cell displayed within the focused row. The focused row isn’t displayed if the DataViewBase.NavigationStyle property is set to GridViewNavigationStyle.None. | |
Returns the focused cell’s value. The focused cell is displayed if the DataViewBase.NavigationStyle property is set to GridViewNavigationStyle.Cell. Otherwise, this method returns null. | |
Returns the value of the specified cell displayed within the specified node. | |
Returns the focused cell’s text. | |
Returns the text displayed within the specified cell. |
Set Cell Values
Method | Description |
---|---|
Sets the value of the specified cell. | |
Sets the value of the specified cell in the specified node. | |
Sets the value of the specified cell displayed within the focused row. The focused row isn’t displayed if the DataViewBase.NavigationStyle property is set to GridViewNavigationStyle.None. |
Note
You can use methods above even if end users are not allowed to edit data.
Once the cell’s value has been changed, the GridViewBase.CellValueChanged event is raised.