Home All Groups Group Topic Archive Search About

DataGridView Questions

Author
25 Dec 2006 1:56 PM
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

Author
25 Dec 2006 7:51 PM
vbnetdev
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

Show quoteHide quote
"Samuel Shulman" <samuel.shul***@ntlworld.com> wrote in message
news:OZ973xCKHHA.2632@TK2MSFTNGP06.phx.gbl...
> 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
>