DataGridView Questions

  • Thread starter Thread starter Samuel Shulman
  • Start date Start date
S

Samuel Shulman

Hi all,

1. How can I control the Font of the control?

2. Is there a way to change the BackColor of individual rows?

Thank you
Samuel
 
Me.dataGridView1.DefaultCellStyle.Font = New Font("Tahoma", 15)

Private Sub dataGrid_CellFormatting(ByVal sender As Object, ByVal e As
DataGridViewCellFormattingEventArgs)
Dim rowIndex As Integer = e.RowIndex
Dim theRow As DataGridViewRow = dataGrid.Rows(rowIndex)

Dim cellValue As Double = CType(theRow.Cells("Quantity").Value, Double)
If cellValue > 50 Then
theRow.DefaultCellStyle.BackColor = Color.Red
Else

End If
End Sub
 
Back
Top