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


Thread ID:





2403 Jan 15,2003 01:23 PM UTC Jan 16,2003 03:35 PM UTC WinForms 4
Tags: GridControl
Joe Nash
Asked On January 15, 2003 01:23 PM UTC

How do I get the results of a GridListControl selection to be automatically accepted without the user having to hit enter or select another cell? Generally, I would prefer this behavior and in this specific case I am using the GridList Control in a dropdowngrid and I want to be able ensure that the last selection is accepted should the user close the dropdowngrid without hitting enter etc. Also, FYI it appears that OnCurrentCellCloseDropDown is not documented along with the other CurrentCell dropdown events.

Administrator [Syncfusion]
Replied On January 15, 2003 04:36 PM UTC

Here is some code that you can add to the CellControlsGrid sample to get this behavior.
private void CellControlsForm_Load(object sender, System.EventArgs e)
	GridDropDownGridListControlCellRenderer cr = 
		(GridDropDownGridListControlCellRenderer) this.gridControl1.CellRenderers["GridListControl"];
	cr.ListControlPart.SelectedValueChanged += new EventHandler(SelectionChanged);

private void SelectionChanged(object sender, EventArgs e)
	GridDropDownGridListControlCellRenderer cr = 
		(GridDropDownGridListControlCellRenderer) this.gridControl1.CellRenderers["GridListControl"];
	int i = cr.ListControlPart.SelectedIndex;
	if(i > -1)
		cr.EditPart.Text = cr.ListControlPart.Grid[i+1, 2].Text;

Joseph Nash
Replied On January 16, 2003 01:22 AM UTC

Thanks for the response but not much sucess with it. I tried the code changes you suggested in the sample (CellControlsGrid) and in my code with different but not correct actions in either case. The code as suggested wouldn't compile beacuse there are no overloads for ConfirmChanges that take any parameters, neither the documentation nor the tool tips shows any alternatives. So I removed the false parameter and it compiled. In the sample the popup drops but as soon as the mouse passes over it closes without an opportunity to click on anything. After insetring a write to the console Console.WriteLine(i.ToString()); if(i > -1) ... -1 is written when the popup drops and the index of the item passed over first is then displayed in output. (by entering the popup from the side I can pass over different items). In my code which is in a custom dropdowngrid, I couldn't hook it in form load so, I did that in OnCurrentCellShowedDropDown (OnCurrentCellShowingDropDown was too early) and later remove it in OnCurrentCellCloseDropDown. I get an event when the control drops and as each item is passed over but the selectedIndex is always -1. I also tried hooking cr.DropDownContainer.CloseUp the event fired but the selectedIndex again is -1. Any thoughts?

Administrator [Syncfusion]
Replied On January 16, 2003 10:22 AM UTC

I am using version In that version, ConfirmChanges has been overloaded to accept a bool parameter that indicates whether or not any dropdown should be closed. This parameter is exactly what is needed in your case to prevent the dropdown from closing prematurely. When the version, the CellControls sample does compile and run and change the valsue displayed in the edit box as you move your mouse over the dropped list. You can get as a private patch from your support home page on our web site. (Click on the Download Latest Service pack link). You might try this code with this release. We will have a public patch available based on this source code in a week or so.

Joseph Nash
Replied On January 16, 2003 03:35 PM UTC

Thnaks that did it. My code was looking at the cellrenderers for the top level grid, changing it to use the currentcell in the dropdowngrid fixed my problem.


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