G
Giorgio
Hi,
Is it possible to add a condition to the value being displayed in a
datagrid template column? Based on the value in the container item I
would like to display one of 2 <asp:Lable> controls.
here is what essentially i'm trying to accomplish
<asp:TemplateColumn HeaderText="ChrgStaDesc" >
<ItemTemplate>
<% if Container.DataItem("detail") <> "" then %>
<asp:Label id= "lblDescription" runat= "server" Text= '<%#
Container.DataItem("detail") %>'></asp:Label>
<% else %>
<asp:Label id= "lblDescription" runat= "server" Text= '<%#
Container.DataItem("detail2") %>'></asp:Label>
<% end if %>
</ItemTemplate>
</asp:TemplateColumn>
thanks in advance!!
Is it possible to add a condition to the value being displayed in a
datagrid template column? Based on the value in the container item I
would like to display one of 2 <asp:Lable> controls.
here is what essentially i'm trying to accomplish
<asp:TemplateColumn HeaderText="ChrgStaDesc" >
<ItemTemplate>
<% if Container.DataItem("detail") <> "" then %>
<asp:Label id= "lblDescription" runat= "server" Text= '<%#
Container.DataItem("detail") %>'></asp:Label>
<% else %>
<asp:Label id= "lblDescription" runat= "server" Text= '<%#
Container.DataItem("detail2") %>'></asp:Label>
<% end if %>
</ItemTemplate>
</asp:TemplateColumn>
thanks in advance!!