Getting Row Information

Operating system requirements: iOS 5.0 or later.

Mobile device: iPad.

Description

This example displays information about table row in the development environment console. After starting the example the following operations are executed:

Source Code

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:

Examples of Component Use