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

ComboBox''s datasource in GridControl

Thread ID:





18281 Aug 27,2004 05:13 AM UTC Aug 27,2004 08:48 AM UTC WinForms 3
Tags: GridControl
Andrey Plinda
Asked On August 27, 2004 05:13 AM UTC

Hello! I have string collection that is used as datasource for combobox in gridcontrol''s cell. After user manually entered new value into cell, this value is also added to string collection. But combobox dropdown list does not change. I have binded string collection to gridcontrol cell once more, but it is have no effect. Best regards!

Administrator [Syncfusion]
Replied On August 27, 2004 05:58 AM UTC

In our grid\samples\celltypes\comboboxes I added a gridControl1.CurrentCellValidating event in Main.cs, and also made StringCollections items a member of the form (and not a local variable). With those changes, adding a new item to teh list in CurrentCellValidating seems to work for me. The item is added as you leave the cell of the of the editable combobox using a choice list.
private void gridControl1_CurrentCellValidating(object sender, CancelEventArgs e)
	String s = this.gridControl1.CurrentCell.Renderer.ControlText;
	if(items.IndexOf(s) == -1)
		Console.WriteLine("New Item Added");

Andrey Plinda
Replied On August 27, 2004 08:13 AM UTC

I found a problem. If in gridcontrol property EnterKeyBehavior is set to "None", after entering new item into cell, choicelist is not updated. Only after moving to another cell''s choicelist will be updated. Is it correct?

Administrator [Syncfusion]
Replied On August 27, 2004 08:48 AM UTC

Yes. The default behavior is to save changes when you leave the cell. If you want the changes to be saved when the dropdown closes, you can handle the CurrentCellCloseDropDown event and call grid.CurrentCell.ConfirmChanges.


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