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.

Value list in GridListControl

Thread ID:





20575 Oct 21,2004 03:53 AM Oct 21,2004 06:59 AM Windows Forms 2
Tags: GridControl
Raul Rosenthal
Asked On October 21, 2004 03:53 AM

I have a grid with a cell that has CellType set to "GridListControl". I have a DataTable with two columns as DataSource for the combo. I set the DropDownStyle to AutoComplete and the ExclusiveChoiceList = false, so that you can type values that are not in the dropdown list. I''d like to let the user know that the value typed in the combo is not in the list (e.g., by displaying it in a distinctive color). I resorted to looking up the value in the DisplayMember column of the DataTable. Still, I wonder if the Grid offers a simpler way, given that it should have some internal method to perform exactly this function. Is there such a method? Thanks, Raul Rosenthal SDB SpA

Administrator [Syncfusion]
Replied On October 21, 2004 05:14 AM

The lookup functionality is down in the cellrenderer.ListBoxPart object. Here is a snippet showing how you might use it in CurrentCellChanged.
private void gridControl1_CurrentCellChanged(object sender, EventArgs e)
	GridDropDownGridListControlCellRenderer cr = this.gridControl1.CurrentCell.Renderer as GridDropDownGridListControlCellRenderer;
	if(cr != null)
		string val = cr.ControlText;
		if(cr.ListControlPart.FindItem(val, false, 0, true) == -1)
			Console.WriteLine("Not found");

Raul Rosenthal
Replied On October 21, 2004 06:59 AM

Exactly what I was looking for! Thanks


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.