你可以在GridView的RowDataBound事件中调用以下函数,当这个字段字符超过maxStrLength时用...代替,而全部字符可显示在ToolTip 中
public void OmitGridInfo(System.Web.UI.WebControls.GridViewRowEventArgs e, int[] cellIndexs, int maxStrLength)
{
string CellText = string.Empty;
for (int i = 0; i < cellIndexs.Length; i++)
{
CellText = e.Row.Cells[cellIndexs[i]].Text.Trim();