Sometimes I lock my Winforms UltrGrid columns, depending on application variables. If the user saves the grid layout while those columns are locked, I cannot unlock the columns.
If blnMyProgramCondition Then grdGrid.DisplayLayout.Bands(0).Columns("Entity").CellActivation = Activation.Disabled grdGrid.DisplayLayout.Bands(0).Columns("Entity").CellAppearance.ForeColorDisabled = Color.Black grdGrid.DisplayLayout.Bands(0).Columns("Entity").CellAppearance.BackColor = Me.BackColor Else grdGrid.DisplayLayout.Bands(0).Columns("Entity").CellActivation = Activation.AllowEdit End If
If blnMyProgramCondition Then
grdGrid.DisplayLayout.Bands(0).Columns("Entity").CellActivation = Activation.Disabled
grdGrid.DisplayLayout.Bands(0).Columns("Entity").CellAppearance.ForeColorDisabled = Color.Black
grdGrid.DisplayLayout.Bands(0).Columns("Entity").CellAppearance.BackColor = Me.BackColor
Else
grdGrid.DisplayLayout.Bands(0).Columns("Entity").CellActivation = Activation.AllowEdit
End If
The above works fine unless I load the grid layout first (in which the columns were locked before saving):
grdGrid1.DisplayLayout.LoadFromXml("MyLayout.xml")
Hello Ted,
Thank you for contacting Infragistics Developer Support!
What do you mean when you say the columns are locked?Do you have a sample you can attach?
Locked for editing; the cursor can enter the cell but you can't edit or change anything, and the drop down button is disabled. This is what I want in certain circumstances. However, after doing the DisplayLayout.LoadFromXml("MyLayout.xml") I don't seem able to re-enable the locked columns. Sorry I don't have a sample - the screen actually has 6 grids on different tabs and is part of a much larger application. Extracting it for a demo would be a job in itself.