Home Forums WinForms controls Xceed Grid for WinForms Conditional BackColor and ReadOnly Reply To: Conditional BackColor and ReadOnly

User (Old forums)
Member
Post count: 23064

Add an event handler for the AddingDataRow event, and in it, do something like this :

Private Sub GridControl1_AddingDataRow(ByVal sender As Object, ByVal e As Xceed.Grid.AddingDataRowEventArgs) Handles GridControl1.AddingDataRow

if( e.DataRow.Cells( “<name or index of your column” ).Value = True) then
e.DataRow.ReadOnly = True
e.DataRow.BackColor = Color.Red
End If

End Sub

Imported from legacy forums. Posted by André (had 373 views)