Note that there are some explanatory texts on larger screens.

plurals
  1. POQuery regarding the nested grid views in asp.net/C#
    text
    copied!<p>I have defined a nested grid view in the following way.</p> <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" OnRowDataBound="GridView1_RowDataBound" GridLines="None"&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="Date Of Transaction" HeaderText="Date Of Transaction" SortExpression="Date Of Transaction" /&gt; &lt;asp:BoundField DataField="Invoice Number" HeaderText="Invoice Number" SortExpression="Invoice Number" /&gt; &lt;asp:BoundField DataField="totalAmount" HeaderText="totalAmount" ReadOnly="True" SortExpression="totalAmount" /&gt; &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;asp:GridView ID="gridView2" runat="server" HorizontalAlign="Left" ShowHeader="false" GridLines="None" OnRowDataBound="gridView2_RowDataBound"&gt; &lt;Columns&gt; &lt;asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px"&gt; &lt;ItemTemplate&gt; &lt;asp:Button ID="Btn1" runat="server" Text="Download" OnClick="Btn1_Click"/&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:ComponentDBConnectionString %&gt;" SelectCommand="SelectUserPreviousHistory" SelectCommandType="StoredProcedure"&gt; &lt;SelectParameters&gt; &lt;asp:Parameter DefaultValue="XYZZ" Name="userName" Type="String" /&gt; &lt;/SelectParameters&gt; &lt;/asp:SqlDataSource&gt; </code></pre> <p></p> <p>The screenshot of the output is <a href="http://postimage.org/image/2ie31u0pw/" rel="nofollow">here</a>. As you can see i have a "Download" button in each row of the child gridview (i.e., gridView2) but I want the download button to be last column but .net is rendering it to be the first column. </p> <p>How can I do it?</p> <p>More over gridview2 datasource is arraylist. Here is the code</p> <pre><code>gridView2.DataSource = titlesArrayList; gridView2.DataBind(); </code></pre> <p>Please help me</p> <p>Thanks in anticipation</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload