How To highlight a row or a column in a datagrid....?

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2007
Posts: 26
Reputation: BalagurunathanS is an unknown quantity at this point 
Solved Threads: 0
BalagurunathanS's Avatar
BalagurunathanS BalagurunathanS is offline Offline
Light Poster

How To highlight a row or a column in a datagrid....?

 
0
  #1
May 24th, 2007
Hi All...

I have a datagrid with values bound to it..I have two columns in the datagrid.The first column is the name field and the second column is age field..Now i need to higlight the highest age which is found in the datagrid..I want to differentiate it from other rows by giving some color differences in the datagrid...

Someone help in this regard....


Balaguru
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 45
Reputation: mike.mclennan is an unknown quantity at this point 
Solved Threads: 0
mike.mclennan's Avatar
mike.mclennan mike.mclennan is offline Offline
Light Poster

Re: How To highlight a row or a column in a datagrid....?

 
0
  #2
May 24th, 2007
  1. Me.CustomersDataGridView.Rows(1).Cells(3).Selected() = True

this is used to selected a row or a cell in the DataGrid

  1. Me.CustomersDataGridView.SelectedCells(0).Style.ForeColor = Color.Coral

This can used to to change the Style (backcolor, font color, etc....) of the now selected cells.

I am sure you can do the work to figure out which of the ages is the highest.... but this will highlight, or bold or whatever you want to do to that row or cell.

Hope this helps 8-D
- mike mclennan
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC