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.

Programmatically selecting a row in the GridListControl

Thread ID:

Created:

Updated:

Platform:

Replies:

6027 Jul 29,2003 07:48 AM Jul 30,2003 01:41 AM Windows Forms 3
loading
Tags: GridControl
Raj Warrier
Asked On July 29, 2003 07:48 AM

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 11:49 AM

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

Raj Warrier
Replied On July 29, 2003 11:14 PM

> 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 01: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.

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.

;