DataGrid row formatting

G

Guest

How can I change the background color/forecolor for specific rows in a datagrid

TIA, Katie
 
M

Marshal Antony

Hi Katie,
You can do it in ItemDataBound event in the datagrid.
For eg:
if(put your condition here){

e.Item.Attributes.Add("style","color:blue;background-color:lightyellow");
}
This will change the font color and background color of the row(s).
HTH,
Regards,

Marshal Antony

..NET Developer

http://www.dotnetmarshal.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top