c# - Merge column header in gridview -


i've been try merge header column 2 1, example , tried gridview.controls[0].controls.addat(0, ogridviewrow); question , example floating around adding 1 column, , add in top of old column, not merging it. want merging 1 column , rest of column still same. here picture of gridview column want merge :

gridview

i want merge "action" column header 2 1. below action column, there edit , delete.

oh forgot, here gridview code handle action column :

<asp:commandfield showeditbutton="true" headertext="action"/>          <asp:templatefield>             <itemtemplate>                 <asp:linkbutton id="linkdelete" runat="server"                     commandargument = '<%# eval("xxx")%>'                     onclientclick = "return confirm('do want delete?')"                     text = "delete" onclick = "deletedetail"></asp:linkbutton>             </itemtemplate>         </asp:templatefield> 

although strictly against hard-coding, have, can write in 'rowdatabound' event of gridview:-

if (e.row.rowtype == datacontrolrowtype.header) {       e.row.cells[3].columnspan = 2;       e.row.cells[4].visible = false;       e.row.cells[3].text = "action"; } 

here, need change cell index according gridview design.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -