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

Selected index change event for combo box

I am using the Combobox in the grid. When ever the selected index is changed i need to hide or unhide the rows. I have 2 issues here
1) I am not able to find the selected index changed event for the combobox
2) How can i get the index of the selected item in the combo box
Please provide pointers to resolve this issue

Thanks in Advance
Raj

1 Reply

HA haneefm Syncfusion Team July 23, 2007 03:18 PM UTC

Hi Raj,

Generally you would use the CurrentCellChanged event to catch when the selected index of a combobox changed. But if you want to get at the SelectedIndexChanged event you can. Note that there is only one combobox and it is shared among all cells that have a ComboBox CellType so you will need to take this into consideration as you catch this event. You catch add code like this in Form.Load to subscribe to the event for all cells.

GridComboBoxCellRenderer cc = this.grid.CellRenderers["ComboBox"] as GridComboBoxCellRenderer;
cc.ListBoxPart.SelectedIndexChanged += new EventHandler(combo_SelectIndexChanged);

To get the new displaymember, try

cc.Renderer.ControlText

To get the new ValueMember, try

cc.Renderer.ControlValue

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon