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
125
UltraGrid - Putting the AddRow into edit mode.
posted

Basically the grid is empty with Allow Add Row on the bottom turned on.  All I need to know is how to activate the first cell of the AddRow and put it into edit mode.

Thanks!

  • 469350
    Verified Answer
    Offline posted

    Hi,

    You could do something like this:

                this.ultraGrid1.Rows.TemplateAddRow.Activate();
                this.ultraGrid1.ActiveRow.Cells[0].Activate();
                this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode, false, false);

    However, please note that you cannot set focus to a control inside the Form_Load event. So if you try this code in Form_Load, it will activate the first cell, but it will not go into edit mode.

    To get around that, use the Form_Shown event. Or... you can use Form_Load and call this code using a BeginInvoke instead of directly in the event handler.