Click here to Skip to main content
15,884,099 members
Articles / Web Development / ASP.NET

How to change the background color of Gridview cell in asp.net c#

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
5 Oct 2012CPOL 0  
hi,You can change the gridview's cell backcolor in ondatabound event of the gridview.Go through the linkshttp://highoncoding.com/Articles/180_Changing_GridView_Column_Color.aspx[^]change cell color of GRIDVIEW based on system date[^]

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
5 Oct 2012Ubaid ur Rahman IT 2 alternatives  
Dear Friends, Good Day to all of u.am working on School Project.I have a Student Database with Student Marks.i have displayed this data in Gridview...it working fine.I have Database Fields as Name Class Section Result ...
Please Sign up or sign in to vote.
5 Oct 2012AmitGajjar
Hi,You need to check if the value is less then the passing marks in OnRowDataBound[^] event of the gridview. And to change the color of that cell you can simply use args.Row.Cells[columnindex].BackColor = Your Color;Hope it helps you,Thanks

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions