/// <summary>
/// gridView字符过长截断显示
/// </summary>
/// <param name="GV">gridView</param>
/// <param name="num">字符显示长度</param>
public static void DataViewShow(GridView GV,int num)
{
for (int i = 0; i < GV.Rows.Count; i++)
{
for (int j = 0; j < GV.Columns.Count; j++)
{
GV.Rows[i].Cells[j].ToolTip = GV.Rows[i].Cells[j].Text;
if ((GV.Rows[i].Cells[j].Text).Length > num)
{
GV.Rows[i].Cells[j].Text = (GV.Rows[i].Cells[j].Text).Substring(0, num) + "...";
}
}
}
}
/// <summary>
/// 隐藏gridView中指定的列
/// </summary>
/// <param name="GV">gridView</param>
/// <param name="row">指定的列</param>
public static void HiddenCol(GridView GV, int row)
{
GV.Columns[row].ItemStyle.CssClass = "hidden";
GV.Columns[row].HeaderStyle.CssClass = "hidden";
GV.Columns[row].FooterStyle.CssClass = "hidden";
}