Hide a gridView row in asp.net

后端 未结 13 777
说谎
说谎 2021-01-14 21:22

I am creating a gridView that allows adding new rows by adding the controls necessary for the insert into the FooterTemplate, but when the Ob

13条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-14 22:00

    You could handle the gridview's databound event and hide the dummy row. (Don't forget to assign the event property in the aspx code):

    protected void GridView1_DataBound(object sender, EventArgs e)
        {
            if (GridView1.Rows.Count == 1)
                GridView1.Rows[0].Visible = false;
        }
    

提交回复
热议问题