Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic colors in grid rows
Message
De
08/08/2004 13:33:55
 
 
À
06/07/2004 09:42:55
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Divers
Thread ID:
00916648
Message ID:
00931641
Vues:
23
>Rick,
>
>I'm not sure if this is what you are looking for but here it is. This will evaluate the field Color_Code and if the value = 1 it will make column 0 in that row red.
>
>
>In the Grids ItemCreated event
>
> If e.Item.DataItem Is Nothing Then Exit Sub
>
> If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
>
> If DataBinder.Eval(e.Item.DataItem, "Color_Code") = 1 Then
> e.Item.Cells(0).ForeColor = System.Drawing.Color.Red
> 'could add code here to make entire row red instead of the first column
> End If
> End If
>
> End Sub
Paul:

Thanks for that -- it was exactly what I was looking for.

Rick
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform