I
Ian Oldbury
Hi,
Does anyone know how to add columns dynamically to a DataGrid.
i populate the grid using the .ItemDataBound
the current structure of my grids are as below....
<asp:templatecolumn>
<headertemplate>
<asp:label id="lblDisp" runat="server" text="" tooltip="" />
</headertemplate>
<itemtemplate>
<asp:label id="lblSales" runat="server" cssclass="GridTDText"></asp:label>
<br />
<asp:label id="lblProfit" runat="server"
cssclass="GridTDText"></asp:label>
<br />
<asp:label id="lblMargin" runat="server"
cssclass="GridTDText"></asp:label>
</itemtemplate>
<asp:textbox id="txtProfit" runat="server" cssclass="GridTextBox
Small"></asp:textbox>
<br />
<asp:textbox id="txtMargin" runat="server" cssclass="GridTextBox
Small"></asp:textbox>
</edititemtemplate>
</asp:templatecolumn>
Does anyone know how to add columns dynamically to a DataGrid.
i populate the grid using the .ItemDataBound
the current structure of my grids are as below....
<asp:templatecolumn>
<headertemplate>
<asp:label id="lblDisp" runat="server" text="" tooltip="" />
</headertemplate>
<itemtemplate>
<asp:label id="lblSales" runat="server" cssclass="GridTDText"></asp:label>
<br />
<asp:label id="lblProfit" runat="server"
cssclass="GridTDText"></asp:label>
<br />
<asp:label id="lblMargin" runat="server"
cssclass="GridTDText"></asp:label>
</itemtemplate>
<br /></asp:textbox>
<asp:textbox id="txtProfit" runat="server" cssclass="GridTextBox
Small"></asp:textbox>
<br />
<asp:textbox id="txtMargin" runat="server" cssclass="GridTextBox
Small"></asp:textbox>
</edititemtemplate>
</asp:templatecolumn>