I need to hide content of a column based on comparing its data with a string. I like to do it in Page itself (Page does not have code behind)
For some reason I cannot use Eval or Bind to retrieve data for column. I’m looking for something like,
<asp:GridView ID="GridView1" runat="server" >
<Columns>
<asp:TemplateField>
<%
if ([data from row] == aVarContainingDataToCompare){
Response.Write("Hidden");
} else {
Response.Write([data from row]);
}
%>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate><%# Eval("AnotherData") %></ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Can I do this without using code behind
Is it alright to use following instead? Please note the
#sign at the start