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

Conditional Enable of Columns

Thread ID:

Created:

Updated:

Platform:

Replies:

8415 Nov 5,2003 01:13 PM UTC Nov 5,2003 02:14 PM UTC Windows Forms 1
loading
Tags: GridControl
ERobishaw
Asked On November 5, 2003 01:13 PM UTC

Using a databound grid, I have 4 columns, 1 of which, say Column 1, is a combobox populated from a datasource. If the selected item in Column1 is "Other" then I want Column 2, of the same row, to be enabled, otherwise, disabled. Here's what I tried which does not work. It virtually hangs the grid, adds random rows to the bottom...its really funky what it does: private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e) { if (e.RowIndex>0 && e.ColIndex==2) { if (gridControl1[e.RowIndex, 1].FormattedText == "Other") { gridControl1[e.RowIndex, 3].Enabled = true; e.Style.Enabled =true; e.Handled =true; //also tried not setting this } else { gridControl1[e.RowIndex, 3].Enabled = false; e.Style.Enabled =false; e.Handled =true; } } }

ERobishaw
Replied On November 5, 2003 02:14 PM UTC

found it. Instead of setting grid[y,x].enabled = false only set the style.enabled=false. Eric

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

;