ShinobiGrid set editing cell keyboardType



To set editing cell, I may need to use willBeginEditingCellAtCoordinate delegate, but I don’t know to get textField from cell to set its keyboardType:

- (void) shinobiDataGrid:(ShinobiGrid *)grid willBeginEditingCellAtCoordinate:(const SGridCoord *) coordinate {
    SGridTextInputCell *cell = (SGridTextInputCell*)[grid visibleCellAtCol:coordinate.column andRow:coordinate.row];

Could anyone help. Thank you.


Greetings Program!

Try doing this to access the textfield:

- (void)shinobiDataGrid:(ShinobiDataGrid *)grid willBeginEditingCellAtCoordinate:(SDataGridCoord *)coordinate
    // Find the cell that will be edited.
    SDataGridTextCell *cell = (SDataGridTextCell*)[shinobiDataGrid visibleCellAtCoordinate:coordinate];
    if ([cell.coordinate.column.title isEqualToString:@"Price"])
	// Get the textfield of the cell. If you have columns with different types of cells then it's
	// better to get the UITextField here or you can put it above after getting the cell if all
	// the columns are the same type.
	UITextField *textField = cell.textField;

	[textField setKeyboardType:UIKeyboardTypeNumberPad];

	// Do other stuff...



Perfect! Thanks a lot. :laughing: