我有一个gridview,我想禁用它的最后5行我该怎么做??下面的代码不起作用
protected void gview_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Enabled = e.Row.RowIndex <= 5; //for disabling last 4 rows
}
}