Grouping Control

I am using a Grouping Grid. Normally I enter some data in the row - the row displays a pencil icon to show I am in edit mode. After entering data - I hit enter to commit changes to the grid row.
How would I commit changes and navigate to the next column below.
Also, how would I commit changes to the grid row by hitting the down arrow or the tab key?


1 Reply

JJ Jisha Joy Syncfusion Team November 29, 2007 10:06 AM UTC

Hi Prem,

Thank you for your interest in Syncfusion Products.

This can be achieved by handling the TableControlCurrentCellKeyDown event of the GridGroupingControl. We can commit changes and navigate to the grid to the below cell in the same column by capturing the Enter key and call the MoveDown() method of e.TableControl.CurrentCell. When the grid is navigate to the next row it will automatically committed the changes. Similarly we can capture the Tab in this event and call the EndEdit method of the e.tableControl.Table to commit the changes.
Here is the code snippets:


void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyEventArgs e)
{
if (e.Inner.KeyCode == Keys.Enter)
{
e.TableControl.CurrentCell.MoveDown();
e.Inner.Handled = true;
e.Inner.SuppressKeyPress = true;
}
if (e.Inner.KeyCode == Keys.Tab)
{
e.TableControl.Table.EndEdit();
}

}

Please refer the sample in the link to illustrate this:
http://websamples.syncfusion.com/samples/Grid.Windows/70115/main.htm

Please try this and let me know if this helps.

Regards,
Jisha



Loader.
Up arrow icon