Last active
December 30, 2017 16:12
-
-
Save lamngockhuong/4a4e978d7339f9135c26 to your computer and use it in GitHub Desktop.
[Using IF ELSE Condition with EVAL function in ASP.Net GridView C#] #csharp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"> | |
<Columns> | |
<asp:BoundField DataField="Id" HeaderText="Id" ItemStyle-Width="50" /> | |
<asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="150" /> | |
<asp:TemplateField HeaderText="Status" ItemStyle-Width="100"> | |
<ItemTemplate> | |
<asp:Label Text='<%# Eval("Status").ToString() == "A" ? "Absent" : "Present" %>' | |
runat="server" /> | |
</ItemTemplate> | |
</asp:TemplateField> | |
</Columns> | |
</asp:GridView> | |
------------------------------- | |
Lam Ngoc Khuong | |
http://ngockhuong.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment