Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
695
Enter act like Tab in UltraGrid -> Need to move to same column + Next row when pressing enter which is in edit mode. How ?
posted

Hi,

The below articile helped me which explains about Enter key act like Tab.

http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=2028

But as per my requirement, I have to move to the same column in the Next row when the enter key is pressed. The column data is in edit mode. How will i achieve this functionality.

Thanks,

Gudi

  • 71886
    Offline posted

    Hello Gudi,

    Please try the following code:

    private void ultraGrid1_KeyDown(object sender, KeyEventArgs e)
    {
    UltraGridCell oldIndex = null;

    switch (e.KeyCode)
    {
    case Keys.Enter:
    oldIndex = ultraGrid1.ActiveCell;
    ultraGrid1.PerformAction(UltraGridAction.ExitEditMode, false, false);
    ultraGrid1.PerformAction(UltraGridAction.BelowRow, false, false);
    ultraGrid1.ActiveCell = ultraGrid1.ActiveRow.Cells[oldIndex.Column];
    e.Handled = true;
    ultraGrid1.PerformAction(UltraGridAction.EnterEditMode, false, false);
    break;

    }

    }

    I wrote about the same thing a day ago in the following forum thread, it might be helpful to you:

    http://ko.infragistics.com/community/forums/p/54541/377015.aspx#377015