I want to set focus to the default 'add-row' in an UltraGrid and put that row in edit mode. How can I access this row? In the documentation this row is referred to as the template add-row and allows the user to add a new row by simply typing into it.
Thanks in advance.
Jay
Hi Jay,
You can access the template add row via the TemplateAddRow property on the rows collection. So for the root level rows, it would go something like this:
this.ultraGrid1.ActiveCell = this.ultraGrid1.Rows.TemplateAddRow.Cells[0]; this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
Bear in mind that you cannot set focus to any control inside events that fire before the form paints, like Form_Load. So this code won't work there. If you want to do this initially when your form is first displayed, you can probably do it by uing BeginInvoke to call a method, rather than calling the code directly.
Thanks Mike, ur solution is working great.
Asad