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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Programatically selecting a row in Grouping Grid Control

Thread ID:





46693 Jul 18,2006 08:51 PM UTC Jul 19,2006 05:16 AM UTC WinForms 1
Tags: GridControl
Gopinath Jayamuni
Asked On July 18, 2006 08:51 PM UTC

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 05:16 AM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon