大于20的不显示吗?那你就在sql理截取好了。
解决方案 »
- 表单行自增
- 如何知道我安装asp.net没有呢?新手问
- 关于Enterprise Library January 2006利用DataSet更新数据库出现的问题
- 类调用及数据库显示问题!------在线等!!
- 程序挑错,源程序如下,有关读Excel表,写入数据库的。
- 怎样在自定义WEB控件中用Java脚本
- 怎样取得存储过程返回的值?(在线=,急)
- 请问如何在webform1的事件里用空白页打开webform2
- 把原来静态的网页改为可以动态发布新闻(文章)的系统?
- DataGrid内容导出到Excel或者Word中的问题,绝对挑战
- 如何判断SqlDataAdapter对象中有无数据?
- 周末散分,心情郁闷,希望能过个轻松的周末,也祝大家周末愉快!
{
if ( e.Item.Cells[0].Text.Length > 10)
{
e.Item.Cells[0].ToolTip = e.Item.Cells[0].Text;
e.Item.Cells[0].Text = e.Item.Cells[0].Text.Substring( 0,10) + "...";
}
}
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
if ( e.Item.Cells[0].Text.Length > 20)
{
e.Item.Cells[0].Text = e.Item.Cells[0].Text.Substring( 0,20) + "...";
}
}
省略符号是什么啊?谢谢
你要先做DataGrid的数据绑定,才会执行ItemDataBound的动作。e.Item.Cells[0].Text = e.Item.Cells[0].Text.Substring( 0,20) + "...";后面的
省略符号是什么啊?谢谢
省略号是为了让你显示的字好看一些,表示还没显示完,用省略号代替。
<itemstyle width="200px"></itemstyle>
<itemtemplate>
</itemtemplate>
</asp:templatecolumn>即可