HA
haneefm
Syncfusion Team
May 1, 2007 10:08 PM UTC
Hi John,
You can try this code snippet in CellButtonClicked event of the grid and let me know if this helps.
private void gridControl1_CellButtonClicked(object sender, GridCellButtonClickedEventArgs e)
{
GridControl grid = sender as GridControl;
if( !grid.CurrentCell.IsEditing )
{
grid.CurrentCell.MoveTo(e.RowIndex,e.ColIndex);
grid.CurrentCell.BeginEdit(true);
object cellText = grid.Model[e.RowIndex,e.ColIndex].CellValue ;
if( cellText != null && cellText.ToString() != string.Empty )
{
int i = int.Parse( cellText.ToString() );
if( e.ButtonIndex == 0 )///Up button
grid.Model[e.RowIndex,e.ColIndex].CellValue = i+1;
else//Down button
grid.Model[e.RowIndex,e.ColIndex].CellValue = i-1;
e.Cancel = true;
}
}
}
Best regards,
Haneef