Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
330
Lock columns in UltraGrid doesn't work after retrieving layout
posted

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

The above works fine unless I load the grid layout first (in which the columns were locked before saving):

grdGrid1.DisplayLayout.LoadFromXml("MyLayout.xml")

Parents Reply Children