编号和换行
if (e.Row.RowIndex > -1)
{
e.Row.Cells[0].Text = Convert.ToString(e.Row .RowIndex+1);
e.Row.Cells[2].Style.Add("work-break", "break-all");
}
{
e.Row.Cells[0].Text = Convert.ToString(e.Row .RowIndex+1);
e.Row.Cells[2].Style.Add("work-break", "break-all");
}
获取标题栏的方法
if (e.Row.RowType == DataControlRowType.Header)
{
for (int i = 1; i < e.Row.Cells.Count; i++)
list.Add(e.Row.Cells[i].Text.ToString());
}
{
for (int i = 1; i < e.Row.Cells.Count; i++)
list.Add(e.Row.Cells[i].Text.ToString());
}