1. 程式人生 > >在GridView中的每一頁末尾添加空行

在GridView中的每一頁末尾添加空行

stat new eight bold tro type creat font grid

原文發布時間為:2008-08-03 —— 來源於本人的百度文章 [由搬家工具導入]

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {    
        int numCol = GridView1.Columns.Count;
        int numRow = GridView1.Rows.Count;
        if (e.Row.RowType == DataControlRowType.Footer)
        {
            GridViewRow gr = new GridViewRow(-1, -1, DataControlRowType.EmptyDataRow, DataControlRowState.Normal);
            for (int j = 0; j < numCol; j++)
            {
                TableCell cell = new TableCell();
                cell.Text = "&nbsp";
                gr.Cells.Add(cell);
            }
            GridView1.Controls[0].Controls.AddAt(numRow + 1, gr);
        }
    }

在GridView中的每一頁末尾添加空行