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

Programmatically selecting a row in the GridListControl

Thread ID:





6027 Jul 29,2003 11:48 AM UTC Jul 30,2003 05:41 AM UTC WinForms 3
Tags: GridControl
Raj Warrier
Asked On July 29, 2003 11:48 AM UTC

Hi All, I have a ComboBoxExt combine with a GridListControl. The GLC has a datasource, displaymember and value member. The selectedValue is bond with value in the dataset. I need to programmatically select a particular row in the ComboBox or the GridListControl, which ever is possible. Please help. Thanks in advance, Raj

Administrator [Syncfusion]
Replied On July 29, 2003 03:49 PM UTC

You can try code like: this.comboBoxExt1.ListControl.SelectedIndex = 4; to select the 4th item (starting at 0).

Raj Warrier
Replied On July 30, 2003 03:14 AM UTC

> You can try code like: > > this.comboBoxExt1.ListControl.SelectedIndex = 4; > > > to select the 4th item (starting at 0). Thanks Clay, I was trying that but to no avail. Finally after a lot of trial and error I found this method.. this.SomeGridListControl.SetSelected(i,true); where i is the 0 based index of the GridListControl and true or false denotes, whether to select or unselect that particular index. Please let me know, if this is the right approach. It seems to work though. Clay, thanks for your help again. Raj

Administrator [Syncfusion]
Replied On July 30, 2003 05:41 AM UTC

I think your code is fine. I would have though the suggested code would work as well as long as the GridListControl has been set to the ComboBoxExt before the code is hit. But there may a focus issue or something that might be interferring with that setting. If so, then maybe setting gridListControl.Grid.ForceCurrentCellMoveTo = true might avoid the issue, but I do not think you need to change what you are doing.


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

Live Chat Icon For mobile
Live Chat Icon