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

Value list in GridListControl

Thread ID:





20575 Oct 21,2004 07:53 AM UTC Oct 21,2004 10:59 AM UTC WinForms 2
Tags: GridControl
Raul Rosenthal
Asked On October 21, 2004 07:53 AM UTC

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

Raul Rosenthal
Replied On October 21, 2004 10:59 AM UTC

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.

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