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

Value list in GridListControl

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

2 Replies

AD Administrator Syncfusion Team October 21, 2004 09:14 AM UTC

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");

RR Raul Rosenthal October 21, 2004 10:59 AM UTC

Exactly what I was looking for! Thanks

Live Chat Icon For mobile
Up arrow icon