asp.net - How Change in CodeBehind HeaderImage in GridView -
how dynamically change image in header?
the idea when grid created in "itemdatabound" event
this grid
<asp:datagrid id="dgmain" runat="server" gridlines="horizontal" autogeneratecolumns="false" allowpaging="false"> <columns> <asp:boundcolumn datafield="pid" visible="false" /> <asp:templatecolumn headerstyle-width="80px" headerimageurl="ico_estadistica_despacho.png"> <itemtemplate> <asp:imagebutton id="btnest" runat="server" borderwidth="0" imageurl="punto.png" commandname="estdesp"/> </itemtemplate> </asp:templatecolumn> <asp:boundcolumn datafield="cotid" visible="false" /> </columns> </asp:datagrid>
i tried something, did not work out.
if e.item.itemtype = listitemtype.header dgmain2.columns.item(1).headerimageurl = "/images/ico_estadistica_despacho_redi.png" end if
Comments
Post a Comment