Articles in this section

How to synchronize the ComboBox item selection with the WinForms GridListControl?

The selected ComboBox value can be synchronized with the WinForms GridListControl by setting the SelectedIndex property of GridListControl based on the ComboBox selection in SelectedIndexChanged event of ComboBox.


C#

//Triggering the event 
this.comboBoxAdv1.SelectedIndexChanged += new EventHandler(comboBoxAdv1_SelectedIndexChanged);
 
//Event Customization 
void comboBoxAdv1_SelectedIndexChanged(object sender, EventArgs e)
{
    //Set the SelectedIndex property of GridListControl.
    this.gridListControl2.SelectedIndex = this.comboBoxAdv1.SelectedIndex;
}
 VB
'Triggering the event
AddHandler comboBoxAdv1.SelectedIndexChanged, AddressOf comboBoxAdv1_SelectedIndexChanged
 
'Event Customization
Private Sub comboBoxAdv1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
    'Set the SelectedIndex property of GridListControl.
    Me.gridListControl2.SelectedIndex = Me.comboBoxAdv1.SelectedIndex
End Sub
Synchronize the selected ComboBox value with the GridListControl as shown below

Synchronize the selected combobox value with GridListControl


Samples:

C# GridListControl CS

VB GridListControl VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied