Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DATAGRID ROW COLOR

Status
Not open for further replies.

3DDD

Programmer
Oct 15, 2003
30
US
Hi All

Can someone please let me know how to color some rows in datagrid based om values in one of the column?

I tried using DataGridTextBoxColumn and Overriding Paint method but no luck.

Thanks in advance.
 
On Itemdatabound,

Code:
Dim drv As DataRowView = CType(e.Item.DataItem, DataRowView)

Then choose your datarow:

If drv("Datarow") = "Whatever You Want" Then
e.Item.BackColor = System.Drawing.Color.Orange
End If
 
Thanks for your reply...

Is Itemdatabound event available for datagrid control in Windows Form? I am using datagrid control in win forms.

Looks like Itemdatabound is true for web based datagrid control.

Any ideas??
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top