We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Activating a Cell After A New Record is Added

I have the SyncFusion Grouping Grid (v6.1.0.34) on a Form. When the user enters the "Add New Row" row, completes the information and hits the Enter key, a new "Add New Row" shows up at the top or bottom, depending on how I've configured the grid.

What I'd like is, after the commit of the new information to the object in the records, for the active cell to return to the first column of the "Add New Row" row.

How do I do this?


1 Reply

RC Rajadurai C Syncfusion Team February 13, 2009 04:03 PM UTC

Hi Curt,

Thanks for your interest in Syncfusion products.

The focus can be set to the new addnew record first cell by handling TableControlCurrentCellEditingComplete and TableControlCurrentCellKeyDown event. Please refer to the following code.

bool b = false;
void gridGroupingControl1_TableControlCurrentCellEditingComplete(object sender, GridTableControlEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (cc.RowIndex == 3)
{
b = true;
}
}

void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (e.Inner.KeyCode == Keys.Enter && b)
{
cc.MoveTo(3, 1, GridSetCurrentCellOptions.SetFocus);
cc.ScrollInView(GridScrollCurrentCellReason.Any);
}
}


Regards,
Rajadurai


Loader.
Live Chat Icon For mobile
Up arrow icon