Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic colors in grid rows
Message
 
 
À
23/06/2004 17:38:59
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Divers
Thread ID:
00916648
Message ID:
00919012
Vues:
7
>I'm developing an interface that uses a grid to display different sets of items. I need to be able to take a column in the dataset and use it to determine the color to display that row on the grid, e.g. if column "color_code" = 1 then the row of the grid containing that data is displayed in red.
>
>Is there any way to do this?
>
>Thanks.
>
>Rick Grinter

Rick, the closest answer I can give you is to decorate the text in the select. That is to say
SELECT (mtOpenTag + MyField + mtCloseTag) as MySelected ... Join on something like the MyTags table below using your criteria. Doing it this way you have full control at a cell level. You can change every aspect bold, italic, create links, the world is your oyster here. I realize it clutters the Select some but the benefits might be worth it. And next week when he says "Oh, make that bold and green instead." you won't have to go to prison for homicide. :) If you want an entire row a particular color you will have to wrap every field. This of course only works in the WEB data grid. If you want anything like this in win forms synchFusion is your solution.
Table MyTags 
mtID   mtOpenTag                                 mtCloseTag    mtDesc 
0                                                              Blank for No Decoration
1      <FONT style="BACKGROUND-COLOR: #FF0000">  </FONT>       Account Denied 
2      <FONT style="BACKGROUND-COLOR: #0000FF">  </FONT>       Account Approved 
2      <FONT style="BACKGROUND-COLOR: #00FFFF">  </FONT>       Account Being Processed 
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform