Display grid based data on the iPad, iPhone and iPod Touch devices. Usage is simple and is similar to usage of UITableView which most developers know well.
Unlike the iPad, the iPhone and the iPod have smaller screens - this component has a combination of two great features to help with the smaller form factor: horizontal scrolling and columns dragging.
The user will be able to easily arrange columns so that the most important data is shown in first 2-3 columns which are usually visible even on the iPhone.

Features:
EXDataGrid dataGrid = [[EXDataGrid alloc] init];
dataGrid.frame = frame;
dataGrid.dataGridDelegate = self; //set delegate
[self.view addSubview:dataGrid]; //and add data grid as subview
[dataGrid release];
//define number of columns in data grid
- (int)numberOfColumnsInDataGrid:(EXDataGrid*)dataGrid;
{
return [dataSource count];
}
//define number of rows in each column
- (int)numberOfRowsInDataGrid:(EXDataGrid *)dataGrid
{
return [[dataSource lastObject] count];
}
//If you want to set different height for different rows
- (float)dataGrid:(EXDataGrid *)dataGrid heightOfRow:(int)rowNumber
{
if(rowNumber == 0) {
return 40;
} else if (rowNumber == 1) {
return 50;
} else {
return 60;
}
}
//You can set different width for different columns
(float)dataGrid:(EXDataGrid *)dataGrid widthOfColumn:(int)columnNumber {
if(columnNumber == 0) {
return 100;
} else if (columnNumber == 1) {
return 110;
} else {
return 120;
}
}
//Customize cell appearance. Inherit you cell from EXDataGridCell class.
- (EXDataGridCell*)dataGrid:(EXDataGrid *)dataGrid cellForColumn:(int)columnNumber row:(int)rowNumber
{
//obtain existing cell
EXDataGridCell *cell = (EXDataGridCell*)[dataGrid cellDequeueReusableIdentifier:identifier forColumn:columnNumber];
if(!cell) {
cell = [[[EXDataGridCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];
}
//set data to the each cell
NSArray *columnData = [dataSource objectAtIndex:columnNumber];
[cell.textLabel setText:[columnData objectAtIndex:rowNumber]];
return cell;
}
Questions & Comments