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.

Programatically selecting a row in Grouping Grid Control

Thread ID:

Created:

Updated:

Platform:

Replies:

46693 Jul 18,2006 04:51 PM Jul 19,2006 01:16 AM Windows Forms 1
loading
Tags: GridControl
Gopinath Jayamuni
Asked On July 18, 2006 04:51 PM

User can select a row from the grid and edit the details and save it to the database. Once the save is done i need to programatically select/highlight the first row . Following code does it grid.BeginUpdate() grid.DataSource =null; grid.DataSource= ds; grid.Table.FilteredRecords[0].SetCurrent(); grid.EndUpdate(true); grid.Refresh(); Even though the first record gets selected with the above code, the previous selected row by the User is also highlighted. Please help me on this.

Administrator [Syncfusion]
Replied On July 19, 2006 01:16 AM

Hi Gopi, By calling Table.SelectedRecords.Clear() method after setting the datasource for the grid, resolves this problem. Change the code as below. grid.BeginUpdate() grid.DataSource =null; grid.DataSource= ds; grid.Table.SelectedRecords.Clear(); grid.Table.FilteredRecords[0].SetCurrent(); grid.EndUpdate(true); You can also select the records programatically using the code below. grid.Table.SelectedRecords.Add( grid.Table.Records[0] ); Let us know if you have any other questions. Thanks for using Syncfusion Products. Regards, Rajagopal

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.

;