Hide a gridView row in asp.net

后端 未结 13 771
说谎
说谎 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:25

    I think this is what you need:

    
        
            
                
                    itemtext
                
                
                    insert controls
                
            
        
    
    

    and the codebehind:

    protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes["style"] = "display:none";
        }
    }
    

    But I do not understand why you are adding your "insert controls" to the footer instead of placing them below the grid.

提交回复
热议问题