asp.net - How to change colspan of a td dynamically in c#? -
<footertemplate> <tr style="background-color:orange;"> < td width="6%" align="center" id = "tdfooter" runat = "server" colspan = "3"> </td> </tr> </footertemplate>
i have repeater control in have footer template. want change colspan of tdfooter @ itemdatabound event(c#) on basis of if clauses.how can same?
if (e.item.itemtype == listitemtype.footer) { if(role = 0) { //tdfooter colspan should 3 } else { //tdfoote colspan should 2 } }
i add runat td tag
<td runat="server" id="tdcontrol">
in itemdatabound:
var td = (htmltablecell)e.item.findcontrol("tdcontrol"); td.attributes.add("colspan", mynumber);
Comments
Post a Comment