Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 9th, 2004, 06:53 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Whitstable, , United Kingdom.
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?
Reply With Quote
  #2 (permalink)  
Old January 9th, 2004, 11:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,111
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.
Reply With Quote
  #3 (permalink)  
Old January 9th, 2004, 12:59 PM
Authorized User
 
Join Date: Jun 2003
Location: Long Island City, NY, USA.
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
Reply With Quote
  #4 (permalink)  
Old January 9th, 2004, 02:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,111
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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

Reply With Quote
  #5 (permalink)  
Old January 9th, 2004, 04:14 PM
Authorized User
 
Join Date: Jun 2003
Location: Long Island City, NY, USA.
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
Reply With Quote
  #6 (permalink)  
Old January 12th, 2004, 04:47 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Whitstable, , United Kingdom.
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.
Reply With Quote
  #7 (permalink)  
Old January 28th, 2005, 12:43 AM
Registered User
 
Join Date: Jan 2005
Location: , , .
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.

Reply With Quote
  #8 (permalink)  
Old April 18th, 2007, 02:32 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I also interested in the answer to this question

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 02: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 07: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 19th, 2004 11:23 PM



All times are GMT -4. The time now is 11:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.