判断本页的行数,添加空行
代码需要整理下再用
-
C# code
-
protected void GrvCode_RowCreated( object sender, GridViewRowEventArgs e)
{
int num = 0 ;
num = GrvCode.Rows.Count;
if (e.Row.RowType == DataControlRowType.Footer)
{
int left = GrvCode.PageSize - num;
int numCol = GrvCode.Rows[ 0 ].Cells.Count;
for ( int i = 0 ;i < left;i ++ )
{
GridViewRow row =
new GridViewRow( - 1 , - 1 ,DataControlRowType.EmptyDataRow,DataControlRowState.Normal);
for ( int j = 0 ; j < numCol; j ++ )
{
TableCell cell = new TableCell();
cell.Text = "   " ;
row.Cells.Add(cell);
}
GrvCode.Controls[ 0 ].Controls.AddAt(num + 1 + i,row);
}
}
}
代码需要整理下再用