griedview内如何更好显示更多的文字内容,界面还美观点 请高手指教。或者用什么控件。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 只显示前15个字,超出的鼠标移动上去或点击弹出一个DIV显示。 只显示前15个字,超出放在ToolTip中!! 使用DIV隐藏移动鼠标显示或使用textbox等控件 rowdatabind事件中加if (hylkUrl.Text.Length > 15) { hylkUrl.ToolTip = hylkUrl.Text; hylkUrl.Text = hylkUrl.Text.Substring(0, 15)+"…………"; } 在GridView的RowDataBound事件写如下代码就可以了. protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string strName = e.Row.Cells[0].Text;// if (strName.Length > 12)//判断它的长度,如果大于12就截取字符串 e.Row.Cells[0].Text = strName.Substring(0, 12) + "...."; e.Row.Cells[0].ToolTip = strName;//ToolTip是鼠标指向的效果。 } } 100求怎么写相对路径,请说具体思路。 怎么通过js获取服务器当前时间 【求助】用IIS运行页面,验证码图片无法显示的问题。 高手进来看看 百度接受参数的方法 在ASP.NET 2.0中dataGrid自带的翻页的问题 判断用户用是否按下了回车或是ALT+回车,是这样写吗? 一个很简单但很让人头疼的问题。 DataGrid数据格式显示大全 Datalist-ItemTemplate etc. -VS.NET 问题 寻求一个asp。net 的访问量统计 超大文本内容操作问题
或使用textbox等控件
if (hylkUrl.Text.Length > 15)
{
hylkUrl.ToolTip = hylkUrl.Text;
hylkUrl.Text = hylkUrl.Text.Substring(0, 15)+"…………";
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string strName = e.Row.Cells[0].Text;//
if (strName.Length > 12)//判断它的长度,如果大于12就截取字符串
e.Row.Cells[0].Text = strName.Substring(0, 12) + "....";
e.Row.Cells[0].ToolTip = strName;//ToolTip是鼠标指向的效果。
}
}