Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 9th, 2004, 07:53 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagrid row color changing - windows vb.net app

VB.Net question on Windows VB.Net datagrids

How can I loop through the rows/cells of a datagrid and
depending on certain criteria - change the background
color of individual rows/cells within the datagrid ?

Any ideas?
 
Old January 9th, 2004, 12:30 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Do you want to alternate the colors? Otherwise you have to use something like this:

add something like this to your html <div id="display" runat="server"></div>

then in add this for the code behind.

For Each r In objDataSet.Tables(0).Rows

            If curmonth <> MonthName(DatePart("m", r("event_date"))) & " " & DatePart("yyyy", r("event_date")) Then
                curmonth = MonthName(DatePart("m", r("event_date"))) & " " & DatePart("yyyy", r("event_date"))
         'do something
Else
     'do something else
End If

Next

You basically want to search through and find a condition and do something once it has been found.
 
Old January 9th, 2004, 01:59 PM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Widows Form or ASP.Net?

It's important for us to explain to our nation that life is important. It's not only life of babies, but it's life of children living in, you know, the dark dungeons of the Internet."— George W. Bush - Arlington Heights, Ill., Oct. 24, 2000
 
Old January 9th, 2004, 03:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

My response was for asp.net if i'm whom you're asking.

 
Old January 9th, 2004, 05:14 PM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks stu9820 I new yours was for ASP.Net I was asking badgolfer. He didn't say what type of application. I have written something to do it in Windows Forms.

It's important for us to explain to our nation that life is important. It's not only life of babies, but it's life of children living in, you know, the dark dungeons of the Internet."— George W. Bush - Arlington Heights, Ill., Oct. 24, 2000
 
Old January 12th, 2004, 05:47 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry guys - I should have said I need to change grid row
colors in a VB.Net windows form.
 
Old January 28th, 2005, 01:43 AM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi Christopher U have not written how to change the row colors in windows vb.net datagrid depending on a coloumn criteria.

 
Old April 18th, 2007, 02:32 PM
Registered User
 
Join Date: Jan 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I also interested in the answer to this question






Similar Threads
Thread Thread Starter Forum Replies Last Post
change row color of DataGrid in VB.Net (Windows ap remya1000 .NET Framework 1.x 2 December 31st, 2007 03:56 AM
color changing windows casemaker Oracle 0 May 28th, 2006 08:29 PM
What Windows can VB .NET App run on ocarroll General .NET 6 February 27th, 2006 08:14 AM
changing datagrid row color msrnivas Classic ASP Components 4 August 5th, 2004 10:58 PM
One for the gurus - grid row color changing badgolfer VS.NET 2002/2003 1 February 20th, 2004 12:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.