开发者

Grid with Eval expressions

开发者 https://www.devze.com 2023-01-04 04:47 出处:网络
I use a Telerik RadGrid control and various \'Eval\' expressions to show data in my aspx pages: <开发者_运维百科;div>

I use a Telerik RadGrid control and various 'Eval' expressions to show data in my aspx pages:

<开发者_运维百科;div>
     Number: <%# Eval("AccountNumber")%>
</div>
<div>
     File: <%# Eval("AccountFile")%>
</div>
...

Sometimes my DataSet is empty (ie. the AccountFile may be missing). How do I write the aspx code so as not to show the Div at all if the expression for the Eval is null or empty?


<%# if(Container.DataItem != null){%>
<div>
     Number: <%# Eval("AccountNumber")%>
</div>
<div>
     File: <%# Eval("AccountFile")%>
</div>
<%}%>
0

精彩评论

暂无评论...
验证码 换一张
取 消