AspxGridView动态加载图片 devexpressasp.netaspxgridview图片 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){ if (e.Row.RowType == DataControlRowType.DataRow) { if(e.Row.Cells[1].Text==-1){e.Row.Cells[1].Text="<img src='../images/settings.png'/>";} //这里可根据你的需求判断呗 }} protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){ if (e.Row.RowType == DataControlRowType.DataRow) {switch (e.Row.Cells[1].Text) { case "0": e.Row.Cells[1].Text = "<img src='../images/0.gif'/>"; break;case "1": e.Row.Cells[1].Text = "<img src='../images/1.gif'/>"; break;case "-1": e.Row.Cells[1].Text = "<img src='../images/2.gif'/>"; break; }}} 谢谢各位回复。可我要的是在AspxGridView控件中,不是GridView控件。RowDataBound事件及e.Rows属性无法使用,请继续指教,谢了先! 前台Columns里加一列<dx:GridViewDataColumn VisibleIndex="7"> <HeaderTemplate> 图片 </HeaderTemplate> <DataItemTemplate> <table> <tr> <td> <%# Eval("Images") %> </td> </tr> </table> </DataItemTemplate></dx:GridViewDataColumn>后台给数据源新增一列Images 给Images列赋值<img src='../images/0.gif'/>; 不知道楼主说的是什么控件了!aspx 是.net开发的web页面后缀,GridView数据控件,在前端页面选择GridView,在事件属性页中找到RowDataBound,双击后输入楼上的代码。 页面编码问题 原来程序还能运行,现在怎么出现这种错误呢??? 关于session超时的问题,ASP.NET站点session超时后,返回登陆页面,常用问题,请大家谈谈自已的思路.(100分) 关于加载水晶报表的老问题,但我还是搞不懂,请帮忙 如何使用web.config? 想学ASP.net 请给个建议 那位仁兄能实现上传文件时进度条的功能 在鼠标落在某一单元格的时候,用tooltip把这一单元格的内容显示出来,我应该怎么取这一单元格的值 TreeView里面如何响应事件 怎样设置网页显示的分辨率,如设为800*600? 求教如何编译asp.net网站 IIS6.0中如何支持.net3.0?
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if(e.Row.Cells[1].Text==-1){e.Row.Cells[1].Text="<img src='../images/settings.png'/>";}
//这里可根据你的需求判断呗
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
switch (e.Row.Cells[1].Text)
{
case "0":
e.Row.Cells[1].Text = "<img src='../images/0.gif'/>"; break;
case "1":
e.Row.Cells[1].Text = "<img src='../images/1.gif'/>"; break;
case "-1":
e.Row.Cells[1].Text = "<img src='../images/2.gif'/>"; break;
}
}
}
<dx:GridViewDataColumn VisibleIndex="7">
<HeaderTemplate>
图片
</HeaderTemplate>
<DataItemTemplate>
<table>
<tr>
<td>
<%# Eval("Images") %>
</td>
</tr>
</table>
</DataItemTemplate>
</dx:GridViewDataColumn>
后台给数据源新增一列Images 给Images列赋值<img src='../images/0.gif'/>;
不知道楼主说的是什么控件了!aspx 是.net开发的web页面后缀,GridView数据控件,在前端页面选择GridView,在事件属性页中找到RowDataBound,双击后输入楼上的代码。