Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a button 'Continue shopping' at the bottom of a Gridview. I want this button to appear always at the bottom whenever the height of Gridview grows due to selection of more rows.
When I tried with 'footer template' , the button is inside the Gridview Gridlines.
XML
</Columns>
</asp:GridView>

<asp:Button ID="BtnContinueShopping"  runat = "server" Text='Continue shopping'    onclick="BtnContinueShopping_Click"
style="z-index: 1; left:450px; top:350px; position: absolute;width:150px;cursor:pointer;  font-family:Arial;  text-align:center; height:22px;  font-weight:600; " >
</asp:Button>
Posted
Comments
So, what is the problem now? You have applied many styles.
S.Rajendran from Coimbatore 2-Dec-13 4:12am    
I actually want the Button to be outside the Gridview at bottom whenever the Gridview increases.
In my code , whenever the GV height increase it overlaps the button at 350px.
In footer template it works but within the GridLines and doesnt look nice. Further I am unable to set the Left-Margin in footer template.
My footer template code:


<%-- <asp:TemplateField>
<footertemplate>
<br />
<asp:Button ID="BtnContinueShopping" runat = "server" Text='Continue shopping' onclick="BtnContinueShopping_Click" style=" margin-left:1px; position:absolute" >


--%>
<asp:CommandField ShowDeleteButton="True" />
<asp:CommandField ShowEditButton="True" ControlStyle-Width="100" EditText="Change Qty" />

That is because you have many styles added to the Button like z-index and position absolute.
Try simple Button outside the GridView with no styles.
S.Rajendran from Coimbatore 2-Dec-13 10:10am    
Yes Thank you I tried. But still it is overlapping. Hope you misunderstood my question!
$*Developer - Vaibhav*$ 2-Dec-13 9:28am    
<table width="100%"><tr><td width="100%"><asp:GridView><columns></td></tr><tr><td align="right">

<asp:Button ID="BtnContinueShopping" runat = "server" Text='Continue shopping' onclick="BtnContinueShopping_Click" style="font-family:Arial; text-align:center; height:22px; font-weight:600; " >

</td></tr>
</table>

as the others said this is your problem. delete it from your button.

"z-index: 1; left:450px; top:350px; position: absolute;"
 
Share this answer
 
What you should do you should remove z-index first and margin or padding
Try to give it in % not in pixel

Hope That Will Work!!
 
Share this answer
 
Comments
S.Rajendran from Coimbatore 2-Dec-13 21:02pm    
Thanks. It works. % is vital. I removed 'position' too.

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