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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Activating a Cell After A New Record is Added

Thread ID:

Created:

Updated:

Platform:

Replies:

79519 Feb 12,2009 08:55 PM UTC Feb 13,2009 04:03 PM UTC WinForms 1
loading
Tags: GridControl
Curtis Schlak
Asked On February 12, 2009 08:55 PM UTC

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?


Rajadurai C [Syncfusion]
Replied On 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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;