Hi there,
There are a few ways to do this. One is change your database query and give it an additional column that either contains the word active or nothing.
An alternative is to create a TemplateField with a label that is bound to a method in the code behind, like this:
Code:
<asp:TemplateField HeaderText="Description" SortExpression="Description">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
GetActiveState(Eval("Description")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
The GetActiveState method could look like this:
Quote:
quote: public string GetActiveState(object o)
{
return "SomeThing";
}
|
Instead of returning SomeThing you can look at the object o that is passed in, convert it to the proper type (e.g. an int) and then return a relevant text.
Does this help?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004