Home Forums WinForms controls Xceed Grid for WinForms Conditional BackColor and ReadOnly

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14496 |

    Hi

    I have a check box in my grid and I want when the grid is loaded for the line that is ticked to true to be made read only and the back colour to be red. I have been struggling with this for a while now so any help would be appreciated. there are some examples in earlier discussions but they are not in vb.net and I cannot seem to convert them.

    Thanks in advance
    Hunny6624

    Imported from legacy forums. Posted by Hunny6624 (had 2790 views)

    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)

    User (Old forums)
    Member
    Post count: 23064

    Hi Andre

    Thank you very much for the response. I have tried to apply the code but when I apply it to the detail grid addingrows handler the detailgrid becomes unviewable. If i apply it to the grid the entire grid becomes unviewable. any idea what I am doing wrong?

    Cheers
    Hunny6624:~

    Imported from legacy forums. Posted by Hunny6624 (had 268 views)

    User (Old forums)
    Member
    Post count: 23064

    I suggest that you send a request to support@xceedsoft.com, with as much details as possible on how you do things (binding: where and how; event handler: where do you add it; etc…), so we can identify why it is not working in your particular case.

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.