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.
Unfortunately, activation email could not send to your email. Please try again.

To get the Focus in the Newly added row

Thread ID:

Created:

Updated:

Platform:

Replies:

19253 Sep 22,2004 02:26 AM Sep 22,2004 09:24 AM Windows Forms 3
loading
Tags: GridControl
Thiyagu
Asked On September 22, 2004 02:26 AM

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.

Administrator [Syncfusion]
Replied On September 22, 2004 04:30 AM

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

Thiyagu
Replied On September 22, 2004 05:08 AM

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 >

Administrator [Syncfusion]
Replied On September 22, 2004 09:24 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;