I have the following code:
It works fine on initially setting up which cells should be enabled or disabled, either cell 1 or cell 2 will be enabled, but not both. The problem comes when I've got enough rows to cause a vertical scroll bar to appear. As I scroll down, BOTH cells will be disabled. Then as I scroll up and down, the problem works its way up the grid until all cells in columns 1 and 2 are disabled and grayed.
Any ideas? Thanks. Please let me know if you need more info.
private void gridAttributes_RowFormatting(object sender, RowFormattingEventArgs e) |
{ |
AttributeBase obj = e.RowElement.RowInfo.DataBoundItem as AttributeBase; |
GridCellElement cell = null; |
if (obj.DataType == "varchar") |
cell = e.RowElement.RowInfo.Cells[2].CellElement; |
else if (obj.DataType == "bit") |
cell = e.RowElement.RowInfo.Cells[1].CellElement; |
cell.Enabled = false; |
cell.DrawFill = true; |
cell.GradientStyle = Telerik.WinControls.GradientStyles.Solid; |
cell.BackColor = SystemColors.ControlLightLight; |
} |
It works fine on initially setting up which cells should be enabled or disabled, either cell 1 or cell 2 will be enabled, but not both. The problem comes when I've got enough rows to cause a vertical scroll bar to appear. As I scroll down, BOTH cells will be disabled. Then as I scroll up and down, the problem works its way up the grid until all cells in columns 1 and 2 are disabled and grayed.
Any ideas? Thanks. Please let me know if you need more info.