.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 12th, 2004, 06:41 AM
Louisa Louisa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Kent, England
Posts: 60 Louisa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m 56 sec
Reputation Power: 5
Row focus and changing row colour

I would like to be able to give a single row within a datagrid focus. I would like to be able to cycle through the datagrid checking a value within a certain cell of each row and according to certain condition give that row focus and then continue and change that single rows background colour and then move on to the next row.


Thanks in advance

Louisa

Reply With Quote
  #2  
Old January 13th, 2004, 08:59 AM
Praveen Kumar Praveen Kumar is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: India
Posts: 2 Praveen Kumar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
OnItem

Hi,

There is a datagrid protected method called 'OnItemDataBound', using this method you can trap each of the Rows and cellls in a datagrid.

For Example:

For i = 0 to dgMine.Items.Count -1

If (dgMine.Items(i).Cells().Text.ToString() = "Some Condition") Then
' Change the Background Color
dgMine.Items(i).BackColor = MyColor
Else
dgMine.Items(i).BackColor = YourColor
End If

Next

Hope this helps.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Row focus and changing row colour


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT