Getting Focus on FirstCell of AddNewRecord

Hi,

I am using GGC. I want to set focus on firstCell of the AddNewRecord when some special keys are pressed. Thanks in advance.

DKP

1 Reply

AD Administrator Syncfusion Team March 9, 2007 03:06 PM UTC

Hi DKP,

You can handle the CurrentCellKeyDown event of the Grid and call the Table.AddNew method to navigate cell focus to add new record in a GridTable. Here is a sample code snippet to show this.

private void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e)
{
if( e.Inner.KeyData == Keys.F2)
{
e.TableControl.Table.AddNew();
e.TableControl.Table.AddNewRecord.SetCurrent("FirstColumnName");
}
}

Best regards,
Haneef

Loader.
Up arrow icon