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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I know, that a ComboBox's drop down list has closed?

Thread ID:





762 Aug 14,2002 08:06 AM UTC Aug 15,2002 06:02 AM UTC WinForms 3
Tags: GridControl
Michael Marake
Asked On August 14, 2002 08:06 AM UTC

I want to know the exact point of time, when the drop down list of a ComboBox has closed, respectively when the user has finished choosing from the list (SelectionChangeComitted). I cannot use the CurrentCellChanged event, because this event is fired each time items from the list are selected with the keyboard's arrow keys. I cannot use the CurrentCellEditingComplete event, because it is fired after leaving the cell. Thanks, Michael

Clay Burch [Syncfusion]
Replied On August 14, 2002 02:30 PM UTC

The GridComboBoxCellRenderer has a DropDownContainer.CloseUp event that you can catch. To hook it, at the bottom of your Form_Load event, get a reference to the combobox cell renderer, and then use that to subscribe to this event.
private void Form1_Load(object sender, System.EventArgs e)

	GridComboBoxCellRenderer cbb  = (GridComboBoxCellRenderer) this.gridControl1.CellRenderers["ComboBox"];
	cbb.DropDownContainer.CloseUp += new PopupClosedEventHandler(ComboBoxClosed);

private void ComboBoxClosed(object sender, PopupClosedEventArgs e)

Michael Marake
Replied On August 15, 2002 05:06 AM UTC

Thanks, that seems to work fine. But when would I subscribe to the CloseUp event in a grid that derives from GridControl? The ComboBoxCellRenderer is not yet in the CellRenderers collection during construction of the grid.

Clay Burch [Syncfusion]
Replied On August 15, 2002 06:02 AM UTC

One thing you could do is to subscribe to the grid's Paint event, and hook the CloseUp there, and also unhook the Paint event handler. This way the Paint event handler is only executed once. public class MyGridControl : GridControl { public MyGridControl():base() { this.Paint += new PaintEventHandler(HookDropDown); } private void HookDropDown(object sender, PaintEventArgs pe) { GridComboBoxCellRenderer cbb = (GridComboBoxCellRenderer) this.CellRenderers["ComboBox"]; cbb.DropDownContainer.CloseUp += new PopupClosedEventHandler(ComboBoxClosed); Console.WriteLine("HookDropDown - should see only once"); this.Paint -= new PaintEventHandler(HookDropDown); } private void ComboBoxClosed(object sender, PopupClosedEventArgs e) { Console.WriteLine("ComboBoxClosed"); } }


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon