How do I add a column with buttons in to a gridview in asp.net?

前端 未结 1 1681
暖寄归人
暖寄归人 2020-12-09 16:50

As my gridview is populating I want to add an extra column with some buttons in but I can\'t seem to figure out how, or what might be the best way. Can anyone get me started

1条回答
  •  既然无缘
    2020-12-09 17:12

    Use a Template Column

    
        
            
            
            
                
                    
                
            
        
    
    
    protected void GridView1_OnRowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName != "SendMail") return;
        int id = Convert.ToInt32(e.CommandArgument);
        // do something
    }
    

    0 讨论(0)
提交回复
热议问题