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.
Syncfusion Feedback

ComboBox''s datasource in GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

18281 Aug 27,2004 01:13 AM Aug 27,2004 04:48 AM Windows Forms 3
loading
Tags: GridControl
Andrey Plinda
Asked On August 27, 2004 01:13 AM

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 01:58 AM

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)
	{
		this.items.Add(s);
		Console.WriteLine("New Item Added");
	}
}

Andrey Plinda
Replied On August 27, 2004 04:13 AM

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 04:48 AM

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.

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.

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

;