Operating system requirements: iOS 5.0 or later.
Mobile device: iPad.
This example displays information about table row in the development environment console. After starting the example the following operations are executed:
The specified table row height is determined.
It is determined whether this row is fixed.
Row index and number are determined.
It is determined whether row contains table headers.
The value of the cell belonging to the obtained row is determined.
A new background color is determined for the table, to which the obtained row belongs.
Executing the example requires to place the following code in the body of the executeExample method of the ViewController class (see the Creating a Simple Data Grid section):
// Get row with the number 1 NuGridRow *row = [[contr gridView] rowWithNumber:1]; // Get table, to which row belongs NuGridView *parentGrid =[row parentGrid]; // Set table background color [parentGrid setBackgroundColor:[UIColor greenColor]]; // Display row height NSLog(@"%@ %f", @"Row height:", row.height); // Display whether row is fixed NSLog(@"%@ %hhd", @"Row is fixed:", row.isFixed); // Display row index NSLog(@"%@ %d", @"Row index:", row.rowIndex); // Display row number NSLog(@"%@ %d", @"Row number:", row.rowNumber); // Display whether row contains table headers NSLog(@"%@ %hhd", @"Row contains table headers:", row.isHeader); // Get row cell NuGridCell *cell = [row cellInColumnWithIndex:1]; // Display cell value NSLog(@"%@ %@", @"Cell value:", cell.value);
After executing the example table background color is changed, and the development environment console displays information about table row:
Row height: 50.000000
Row is fixed: 0
Row index: 1
Row number: 1
Row contains table headers: 0
Cell value: 2
See also: