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. Image for the cookie policy date

To get the Focus in the Newly added row

Hi Clay, After adding a new row, if the User clicks Save, the Changes will be updated in the database and the Grid will be refreshed. Here, how do I set the focus to the newly added/edited row once the Grid is refreshed. As of now, the fiocus is on the first row of the Grid. FYI.. I''m using GDGB grid.

3 Replies

AD Administrator Syncfusion Team September 22, 2004 08:30 AM UTC

Before you update the changes to the database try to get all the information from the grid about the current record that you can later use to look up the record in the datatable. Best would be the primary key of the record. Then after the grid was refreshed do a DataTable.DefaultView.Find and find the record in the underlying data table. If you do not have a primary key you will have to manually loop thourgh all records in the DataTable until you find a match. This will give you the record index of the added row and you can then call grid.Binder.CurrentPosition = recordIndex; Stefan


TH Thiyagu September 22, 2004 09:08 AM UTC

Thanks Steve. Further, I''m using Querycellinfo event in my screen. My Grid has got 17 columns and 40 or more number of rows. As soon as I added this QueryCelInfo event, its taking to much of time to Load. Is there any way to overcome this problem. Thanks. Thiagu. >Before you update the changes to the database try to get all the information from the grid about the current record that you can later use to look up the record in the datatable. Best would be the primary key of the record. > >Then after the grid was refreshed do a DataTable.DefaultView.Find and find the record in the underlying data table. If you do not have a primary key you will have to manually loop thourgh all records in the DataTable until you find a match. > >This will give you the record index of the added row and you can then call grid.Binder.CurrentPosition = recordIndex; > >Stefan >


AD Administrator Syncfusion Team September 22, 2004 01:24 PM UTC

You should not do time consuming things in QueryCellInfo since it is called for every cell. That would explain why your grid slows down. Try to cache settings and then simply set the style settings based on your cache when your are inside QueryCellInfo. Stefan

Loader.
Live Chat Icon For mobile
Up arrow icon