NGridDataSource Protocol Reference

Conforms to NSObject
Declared in NGridDataSource.h

Overview

The NGridDataSource protocol defines methods that should be implemented to provide the grid data.

– gridView:cellWithKey: required method

Asks the data source to return the cell by key.

- (NGridCell *)gridView:(NGridView *)gridView cellWithKey:(NGridCellKey *)cellKey

Parameters

gridView

Grid view that requests the cell.

cellKey

Key of the needed cell.

Declared In

NGridDataSource.h

– gridView:valueForCellWithKey: required method

Asks the data source to return the cell value by the cell key.

- (NSObject *)gridView:(NGridView *)gridView valueForCellWithKey:(NGridCellKey *)cellKey

Parameters

gridView

Grid view that requests the cell.

cellKey

Key of the needed cell.

Declared In

NGridDataSource.h

– gridViewRowCount: required method

Asks the data source to return the number of the rows.

- (NSInteger)gridViewRowCount:(NGridView *)gridView

Parameters

gridView

Related grid view object.

Declared In

NGridDataSource.h

– gridViewColumnCount: required method

Asks the data source to return the number of the columns.

- (NSInteger)gridViewColumnCount:(NGridView *)gridView

Parameters

gridView

Related grid view object.

Declared In

NGridDataSource.h

– gridViewRowHeaderCount: required method

Asks the data source to return the number of the row headers.

- (NSInteger)gridViewRowHeaderCount:(NGridView *)gridView

Parameters

gridView

Related grid view object.

Declared In

NGridDataSource.h

– gridViewColumnHeaderCount: required method

Asks the data source to return the number of the column headers.

- (NSInteger)gridViewColumnHeaderCount:(NGridView *)gridView

Parameters

gridView

Related grid view object.

Declared In

NGridDataSource.h

– gridView:indentForCellWithKey:

Asks the data source to return the cell text indentation.

- (NSInteger)gridView:(NGridView *)gridView indentForCellWithKey:(NGridCellKey *)cellKey

Parameters

gridView

Grid view that requests cell.

cellKey

Key of the needed cell.

Declared In

NGridDataSource.h

– gridView:parentRowKeyForRowWithKey:

Asks the data source to return the key of the row which is a parent for the specified one.

- (NSInteger)gridView:(NGridView *)gridView parentRowKeyForRowWithKey:(NSInteger)rowKey

Parameters

gridView

Related grid view object.

rowKey

Key of the row.

Declared In

NGridDataSource.h

– gridView:parentColumnKeyForColumnWithKey:

Asks the data source to return the key of the column which is a parent for the specified one.

- (NSInteger)gridView:(NGridView *)gridView parentColumnKeyForColumnWithKey:(NSInteger)columnKey

Parameters

gridView

Related grid view object.

columnKey

Key of the column.

Declared In

NGridDataSource.h

– cellUnionSetForGridView:

Asks the data source to return union set for grid view.

- (NGridCellUnionSet *)cellUnionSetForGridView:(NGridView *)gridView

Parameters

gridView

Related grid view object.

Declared In

NGridDataSource.h

– gridViewCanSelectRowsAndColumns:

Asks the data source whether selection is allowed. Return YES to allow selection in the grid.

- (BOOL)gridViewCanSelectRowsAndColumns:(NGridView *)gridView

Parameters

gridView

Related grid view object.

Declared In

NGridDataSource.h

– gridView:setValue:forCellWithKey:

Asks the data source to set the value by the cell key.

- (void)gridView:(NGridView *)gridView setValue:(NSObject *)value forCellWithKey:(NGridCellKey *)cellKey

Parameters

gridView

Related grid view object.

value

Value for cell.

cellKey

Key of the cell.

Declared In

NGridDataSource.h

– gridView:rowWithKeyIsSection:

Asks the data source whether specified row is section.

- (BOOL)gridView:(NGridView *)gridView rowWithKeyIsSection:(NSInteger)rowKey

Parameters

gridView

Related grid view object.

rowKey

Key of the row.

Declared In

NGridDataSource.h

– gridView:columnWithKeyIsSection:

Asks the data source whether specified column is section.

- (BOOL)gridView:(NGridView *)gridView columnWithKeyIsSection:(NSInteger)columnKey

Parameters

gridView

Related grid view object.

columnKey

Key of the column.

Declared In

NGridDataSource.h

– compareCellValue:toCellValue:caseInsensitive:

Compare two cell values. This method is called when the grid is being sorted to compare the pairs of cell values.

- (NSComparisonResult)compareCellValue:(NSObject *)cellVal1 toCellValue:(NSObject *)cellVal2 caseInsensitive:(BOOL)caseInsensitive

Parameters

cellVal1
  • first cell value to compare.
cellVal2
  • second cell value to compare.
caseInsensitive
  • flag determining if the case (if applied) should be ignored (YES) or taken into account (NO).

Return Value

comparison result.

Declared In

NGridDataSource.h