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

Conditional Enable of Columns

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; } } }

1 Reply

ER ERobishaw November 5, 2003 02:14 PM UTC

found it. Instead of setting grid[y,x].enabled = false only set the style.enabled=false. Eric
Loader.
Live Chat Icon For mobile
Up arrow icon