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.
Thanks in advance,
ADAdministrator Syncfusion Team July 29, 2003 10:49 AM
You can try code like:
this.comboBoxExt1.ListControl.SelectedIndex = 4;
to select the 4th item (starting at 0).
RWRaj WarrierJuly 29, 2003 10:14 PM
> You can try code like:
> this.comboBoxExt1.ListControl.SelectedIndex = 4;
> to select the 4th item (starting at 0).
I was trying that but to no avail. Finally after a lot of trial and error I found this method..
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.
ADAdministrator Syncfusion Team July 30, 2003 12:41 AM
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.