- 2 minutes to read
An individual row can be accessed by the VerticalGridRowCollection.Item property by specifying one of the following row characteristics.
- Index - A row's index within the collection: the CollectionItem.Index property value.
- Name - A row's unique identifier name: the WebColumnBase.Name property value.
- FieldName - The name of a row's bound data source field: the VerticalGridDataRow.FieldName property value.
- Caption - A row's caption: the WebColumnBase.Caption property value.
The following priority applies when you use string row identifiers to search for a row.
- First, the Name property match is searched for.
- Then, the first FieldName property match is searched for.
- Lastly, the first Caption property match is searched for.
Below is an example of how to access rows using different row characteristics.
// Accessing a row by specifying its unique identifier name - a row's Name property is set to 'MyRow1'. VerticalGridRow colMyRow = ASPxVerticalGrid1.Rows["MyRow1"]; // Accessing a row by specifying the name of the data source field to which it is bound - a row's FieldName property is set to 'Department'. VerticalGridRow colDepartment = ASPxVerticalGrid1.Rows["Department"]; // Accessing a row by specifying its caption - a row's Caption property is set to 'Primary Phone'. VerticalGridRow colPhone = ASPxVerticalGrid1.Rows["Primary Phone"]; // Accessing a row by its index within the Rows collection. VerticalGridRow colFirstRow = ASPxVerticalGrid1.Rows;