在asp.net網格視圖中,我添加了一個TemplateColumn,我需要將其寬度設置爲0,即使我將它設置爲HTML代碼或代碼後面在瀏覽器中顯示它有一個寬度。如何解決這個問題?無法設置ASP.Net Gridview模板列寬爲0
HTML
<asp:TemplateField Visible="False" ControlStyle-Width="0">
<HeaderStyle BorderWidth="0" Width="0"></HeaderStyle>
<ItemStyle BorderWidth="0" Width="0"></ItemStyle>
<FooterStyle BorderWidth="0" Width="0"></FooterStyle>
<ItemTemplate>
<itemstyle width="0" />
<asp:PlaceHolder ID="ExpandedContent" Visible="false" runat="server"></td> </tr>
<tr>
<td class="label" colspan="2" align="left">
Test</asp:PlaceHolder>
</td> </tr>
</ItemTemplate>
<FooterStyle BorderWidth="0px" Width="0px" />
</asp:TemplateField>
輸出HTML
輸出
Ÿ不要你使其可見=假.......有任何共振? –
@Pranay是的,無法將其可見性設置爲false,因爲我在做一些棘手的事情(根據本教程http://www.codeproject.com/KB/aspnet/Drill_down_Datagrid.aspx)。需要將其寬度設置爲0,但其內容顯示在gridview中的其他位置。 – Nalaka526