Click here to Skip to main content
16,017,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to merge cells 5,6,7 of header
C#
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
       {
           if (e.Row.RowType == DataControlRowType.DataRow)
           {
               Button btn = new Button();
               //btn.Text = "preview";
               e.Row.Cells[5].Controls.Add(btn);
               btn.CausesValidation = false;
               btn.Text = "preview";

               Button btn1 = new Button();
               //btn.Text = "preview";
               e.Row.Cells[6].Controls.Add(btn1);
               btn1.CausesValidation = false;
               btn1.Text = "edit";


               Button btn2 = new Button();
               //btn.Text = "preview";
               e.Row.Cells[7].Controls.Add(btn2);

               btn2.CausesValidation = false;
               btn2.Text = "close";



           }

         }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900