hi i want to change the color of rows in a datasheet that is i want each rows to be of one color. Is it possible?

Recommended Answers

All 3 Replies

What's a datasheet? do you mean a DataGrid or GridView control? just set the BackgroundColor property.

For Datagrid

if u want to change the datagrid color,,,,
Use datagrid_itemdatabound()
If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType = ListItemType.AlternatingItem) Then
Dim value As String = Trim(e.Item.DataItem("Sex"))
If value = "male" Then
e.Item.BackColor = System.Drawing.Color.Chocolate ' i is the index of the particular column
End If
End If
--------------
change according to ur requirement...!!
regards,,,
preetham....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.