Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

gridview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roger - 31 Dec 2007 10:38 GMT
Hi All

hope you can help here

Is it possiable to change the colour of a row in a gridview depending on the
content of one cell ?

Hope that makes sense

Happy New year to all

Roger
Eliyahu Goldin - 31 Dec 2007 13:02 GMT
You can do it in either RowDataBound or PreRender event:

   protected void allGrids_OnRowDataBound(Object sender,
System.Web.UI.WebControls.GridViewRowEventArgs e)
   {
       if (e.Row.RowType == DataControlRowType.DataRow)
       {
            System.Web.UI.WebControls.TableCell cell =
e.Row.Cells[myIndex];
            if (check something for cell)
           {
                  e.Row.(set properties as needed)
           }
       }
   }

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

> Hi All
>
[quoted text clipped - 8 lines]
>
> Roger
John Timney (MVP) - 31 Dec 2007 13:03 GMT
Theres an example here

http://msdn2.microsoft.com/en-us/library/aa479342.aspx

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog

> Hi All
>
[quoted text clipped - 8 lines]
>
> Roger

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.