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 Selected Value

Thread ID:





21893 Nov 25,2004 10:38 PM UTC Nov 26,2004 06:20 AM UTC WinForms 1
Tags: GridControl
Bernard Herrok
Asked On November 25, 2004 10:38 PM UTC

Hi, I have a databound grid with a cell which is of type combobox (bound to another dataset). I''d like to set the next 2 cells enabled/disabled according to the selection of the combobox. e.g. if combobox is "Next Year" then the next 2 cells are disable if it''s "Base Year" then the next 2 cells are enabled. Thanks in advanced.

Administrator [Syncfusion]
Replied On November 26, 2004 06:20 AM UTC

Try handling the grid.Model.QueryCellInfo event. In your handler, if e.RowIndex > 0 and if e.ColIndex points to one of the ''next two cells'' you mentioned, then get the value of the comboxcell and set e.Style.Enabled accordingly.
private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
	if(e.RowIndex > 0)
		if(e.ColIndex == this.grid.Binder.NameToColIndex("NextCol1")
			|| e.ColIndex == this.grid.Binder.NameToColIndex("NextCol2"))
			int col = this.grid.Binder.NameToColIndex("ComboCol");
			string val = this.grid[e.RowIndex, col].Text; //may want .FormattedText
			if(val == "NextYear")
				e.Style.Enabled = true;
				e.Style.Enabled = false;


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