Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.
Do more with
Private Sub FormatGridRow(ByVal sender As Object, _
ByVal e As DataGridFormatCellEventArgs)
Dim discontinuedColumn As Integer = 0
' Conditionally set properties in e depending upon e.Row and e.Col.
Dim discontinued As Boolean = CBool( _
IIf(e.Column <> discontinuedColumn, _
Me.DataGrid1(e.Row, discontinuedColumn), _
e.CurrentCellValue))
' Check if discontinued?
If e.Column > discontinuedColumn AndAlso _
CBool(Me.DataGrid1(e.Row, discontinuedColumn)) Then
e.BackBrush = Me.disabledBackBrush
e.ForeBrush = Me.disabledTextBrush
' current row?
ElseIf e.Column > discontinuedColumn AndAlso _
e.Row = Me.DataGrid1.CurrentRowIndex Then
e.BackBrush = Me.currentRowBackBrush
e.TextFont = Me.currentRowFont
End If
End Sub
Premium Content
You need an Expert Office subscription to comment.Start Free Trial