Hi,
How can I add a new row to the ultra grid which is already bound with a datatable.
I need to create a row by hitting the tab at the end of the row or enter key.
Thanks in advance.
Regards,
Arun
Hi Arun,
The easiest thing to do would be to use the AllowAddNew property on the grid.DisplayLayout.Override. You could set it to TemplateOnBottom and that would give the user an AddNewRow that they could simply tab into.
If that's no good for your application, then you would have to somehow trap the Tab/Enter key (using KeyDown or maybe KeyPress on the grid) and try to detect if the focus is on the last row or last cell and then call the AddNew method on the band and then set the ActiveCell to a cell in the new row and use PerformAction to put that cell into edit mode.
Hi Mike,
The above suggestion was provided by you.
Could u suggest me how to do this ?
I'm not sure what more you are looking for. In fact, I'm still not sure I understand the issue. I'm wondering now if what you said about entering the control is important because the grid is not in edit mode at that point.
If that's the case, then you really just need to make sure there's a cell in edit mode when the grid's Enter event fires.
Are you saying that when you tab into the grid from another control and then press Tab again, focus leaves the grid immediately? Or are you saying that you are tabbing through the cells in the grid and it still doesn't add a new row?
Perhaps you could post a small sample project demonstrating the behavior you are getting and that would clear up the confusion.