Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help me in setting backcolor of particular Cell

Status
Not open for further replies.

nomi2000

ISP
Feb 15, 2001
676
0
0
CA
Hi guys
I have a datagrid which is binded to a table
the DataGrid shows records in this maaner
There are 17 Weeks fixed for column
Week1 Week2 Week3 Week4 ------ Week17
User A 12 5 -----
User B 8 10
User C 12 7
User D 10 10
--------------------------------------------
--------------------------------------------

Now i want to change the backcolor of Cell for each user which got MAXIMUM Score on that week
Regards
Nouman

Nouman Zaheer
Software Engineer
MSR
 
You'll probably have to process this information in the ItemDataBound event, after the information is obtained, and just prior to processing the datagrid(during binding of the data to the grid). There is at least one example of this in Microsoft's help directory (easy to find).

Try doing a fairly extensive search on the web at other ASP.NET forums, including the Key help here.

There are several examples out there of processing styles during the ItemDataBound event.
 
If you can identify the row you want to work with, you can use this code in the ItemCreated event to set the backcolor of a cell.

e.item.Cells(2).backcolor=system.Drawing.ColorTranslator.FromOle(&Hff66ff&)

Good Luck
TT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top