Combo Box Index

I need a way to get the index of the combo box when it is closed. Such as, if there are three items in a combo box, and the last one is selected, I need to know that that index 3 (or 2, depending on the base) was selected. This is fairly simple in the .net combo box, is there a way to get this index? Thanks.

1 Reply

AD Administrator Syncfusion Team January 6, 2004 06:24 PM UTC

You can handle the CurrentCellClosedxropDown event and access the list at that point to get the SelectedIndex.
private void gridControl1_CurrentCellCloseDropDown(object sender, PopupClosedEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
	if(cr != null)
	{
		Console.WriteLine(cr.ListBoxPart.SelectedIndex);
	}
}

Loader.
Up arrow icon