GridView记录编号和强行换行(学习笔记)

下面的代码写在RowDataBind函数里
编号和换行
  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");
        }

获取标题栏的方法
    if (e.Row.RowType == DataControlRowType.Header)
        
{
            
for (int i = 1; i < e.Row.Cells.Count; i++)
                list.Add(e.Row.Cells[i].Text.ToString());
        }
posted on 2008-01-26 17:40  ringwang  阅读(301)  评论(0编辑  收藏  举报