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
close icon

Programmatically selecting a row in the GridListControl

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

3 Replies

AD Administrator Syncfusion Team 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).


RW Raj Warrier 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


AD Administrator Syncfusion Team 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.

Loader.
Live Chat Icon For mobile
Up arrow icon