用“...”代替过长字符串后,编辑行不能出现修改用的文本框 如题。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是解决超长字符串的代码,写在BindGridView()函数里 for (int i = 0; i <= GridView2.Rows.Count - 1; i++) { DataRowView mydrv; string gIntro; for (int j = 0; j < GridView2.Columns.Count - 2; j++) { if (GridView2.PageIndex == 0) { mydrv = myds.Tables[0].DefaultView[i]; gIntro = Convert.ToString(mydrv[j]); GridView2.Rows[i].Cells[j].Text = SubStr(gIntro, 4); } else { mydrv = myds.Tables[0].DefaultView[i + (20 * GridView2.PageIndex)]; gIntro = Convert.ToString(mydrv[j]); GridView2.Rows[i].Cells[j].Text = SubStr(gIntro, 4); } } }可以解决超长字符串问题,但是此时点击编辑按钮,编辑行不能出现TextBox按钮,无法编辑。 你问题的原因就是你在处理超长问题时将GridView的编辑模板弄没了。你要想别的办法处理,下面给你个建议:你要在GrivdView模板里操作,用三元运算节字符串。 a.Length>18?a.substring(0,17)+'...':a 密码取不到 在线求--- ASP.NET怎么实现会员的头像功能。 慕白兄等刚才回答了权限问题的进 radiobuttonlist 没有SelectValue属性 一个关于存储过程的问题! 如何把sqlserver中的表内容倒成excel文件阿?? script转换为js文件中的语句该如何写 后台线程不会使托管执行环境处于活动状态--也就是说对象要自己销毁吗? 各位大虾请指教如何消除窗口上的title?? 寻求配置单.net开发 Nhibernate+MVC+spring.net发布所需要的服务器环境条件 急!急!急!
for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
{
DataRowView mydrv;
string gIntro;
for (int j = 0; j < GridView2.Columns.Count - 2; j++)
{
if (GridView2.PageIndex == 0)
{
mydrv = myds.Tables[0].DefaultView[i];
gIntro = Convert.ToString(mydrv[j]);
GridView2.Rows[i].Cells[j].Text = SubStr(gIntro, 4);
}
else
{
mydrv = myds.Tables[0].DefaultView[i + (20 * GridView2.PageIndex)];
gIntro = Convert.ToString(mydrv[j]);
GridView2.Rows[i].Cells[j].Text = SubStr(gIntro, 4);
}
}
}可以解决超长字符串问题,但是此时点击编辑按钮,编辑行不能出现TextBox按钮,无法编辑。
你要想别的办法处理,下面给你个建议:你要在GrivdView模板里操作,用三元运算节字符串。