We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Changing backColor for a row in gridDataBoundGrid

How can i change back color for a specific list of rows in a gridDataBoundGrid ?

1 Reply

AD Administrator Syncfusion Team January 27, 2003 02:58 PM UTC

Handle the PrepareViewStyleInfo event, and then set e.Style.BackColor depending upon the value of e.RowIndex.
    Private Sub GridDataBoundGrid1_PrepareViewStyleInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs) Handles GridDataBoundGrid1.PrepareViewStyleInfo
        If e.RowIndex mod 2 = 1 Then
            e.Style.BackColor = Color.Blue

        End If
    End Sub

Loader.
Live Chat Icon For mobile
Up arrow icon