Click here to Skip to main content
15,886,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How i can have more than a single row in the footer of the grid view by clicking a button?
Posted

Yes. you can have something like this...

ASP.NET
<footertemplate>
    <table>
        <tr>
           <td>
            <asp:label id="Label1" runat="server" text="First Row First Control" >

<asp:textbox id="txtbox1" runat="server" text="First Row Second Control" >
            </td>
        </tr>
        <tr>
            <td>
                  <asp:label id="Label2" runat="server" Text="second row first control"> 
  <asp:TextBox id="txtbox2" runat="server" Text="Second row second control"></td></tr></table></footertemplate>
 
Share this answer
 
v2
protected void GridShow_DataBound(object sender, EventArgs e)

// {

// for (int rowIndex = GridShow.Rows.Count - 2; rowIndex >= 0; rowIndex--)

// {

// GridViewRow gvRow = GridShow.Rows[rowIndex];

// GridViewRow gvPreviousRow = GridShow.Rows[rowIndex + 1];

// for (int cellCount = 0; cellCount < gvRow.Cells.Count; cellCount++)

// {

// if (gvRow.Cells[cellCount].Text == gvPreviousRow.Cells[cellCount].Text)

// {

// if (gvPreviousRow.Cells[cellCount].RowSpan < 2)

// {

// gvRow.Cells[cellCount].RowSpan = 2;

// }

// else

// {

// gvRow.Cells[cellCount].RowSpan = gvPreviousRow.Cells[cellCount].RowSpan + 1;

// }

// gvPreviousRow.Cells[cellCount].Visible = false;

// }

// }

// }

// }
 
Share this answer
 
<footertemplate>
<table>
<tr>
<td>
<asp:label id="Label1" runat="server" text="First Row First Control" >

<asp:textbox id="txtbox1" runat="server" text="First Row Second Control" >
</td>
</tr>
<tr>
<td>
<asp:label id="Label2" runat="server" Text="second row first control">
<asp:TextBox id="txtbox2" runat="server" Text="Second row second control"></td></tr></table></footertemplate>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900