关于DataGrid控件中的列绑定!在线等。解决给分
我想根据数据库中的不同值来绑定不同的图片,不知道该怎么办,下面代码不知道行不行,如果不行,请给出源代码
<asp:TemplateColumn>
<ItemTemplate> <table width="30px" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <% Dim count As Integer %> = <%# DataBinder.Eval(Container.DataItem,"LWRestoreDegree")%> <%
If count = 0 Then Response.Write("<img src='Images\topic.gif' border='0'>") Else If (count > 0) And (count) < 15 Then Response.Write("<img src='Images\topic_n.gif' border='0'>") Else
Response.Write("<img src='Images\topic_hn.gif' border='0'>") End If %>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate> <table width="30px" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <% Dim count As Integer %> = <%# DataBinder.Eval(Container.DataItem,"LWRestoreDegree")%> <%
If count = 0 Then Response.Write("<img src='Images\topic.gif' border='0'>") Else If (count > 0) And (count) < 15 Then Response.Write("<img src='Images\topic_n.gif' border='0'>") Else
Response.Write("<img src='Images\topic_hn.gif' border='0'>") End If %>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
...全文
相关推荐
WPF_MVVM中DataGrid列中使用ComBox绑定
WPF之MVVM中DataGrid中嵌入Combox,改变Combox可回传至绑定的实体
vb中datagrid控件的详细使用方法
vb中datagrid控件的详细使用方法,拿出来给大家看看!!!!是学习datagrid控件的好助手
DataGrid模板列自定义控件
DataGrid模板列自定义控件使用,依赖属性的绑定
Wince DataGrid动态添加列和绑定数据 并修改数据
Wince DataGrid动态添加列和绑定数据 并修改数据 ----------------------------------------------- 对于DataGrid中 值的修改 是参考别人的代码加上自己的一些方法做出来的!
C#WPF之DataGrid用法
结合实例很好的讲解了DataGrid中数据绑定,与数据操作即增删改查,还有分页功能。适合初学者快速的掌握DataGrid 的典型应用


