1 protected void g_Message_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e) 2 { 3 if (e.Column.FieldName == "字段") 4 { 5 if (e.Value != null) 6 { 7 string cellValue = e.Value.ToString(); 8 if (cellValue.Length > TextMaxLength) 9 e.DisplayText = cellValue.Substring(0, TextMaxLength) + "..."; 10 } 11 } 12 } 13 14 protected void g_Message_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e) 15 { 16 if(e.DataColumn.FieldName == "字段") 17 if(e.CellValue != null) 18 e.Cell.ToolTip = e.CellValue.ToString(); 19 }