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.

Combo Box Index

Thread ID:

Created:

Updated:

Platform:

Replies:

9673 Jan 6,2004 11:25 AM Jan 6,2004 01:24 PM Windows Forms 1
loading
Tags: GridControl
Doug
Asked On January 6, 2004 11:25 AM

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.

Administrator [Syncfusion]
Replied On January 6, 2004 01:24 PM

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);
	}
}

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.

;