I am trying to use scrollable GridView in my page but the problem is that the Header and the field or the cell contents are not aligned. In other words, my Cells or Fields are not aligned with the Header; they are little bit shifted to the right. Everything
was aligned perfectly before I apply the JQuery Scrollable function and now I am not sure how to fix this. Can someone help? thanks Here is my code
karinos57
Member
24 Points
108 Posts
JQuery Scrollable GridView with Fixed Header in ASP.Net
Nov 19, 2012 09:05 PM|LINK
I am trying to use scrollable GridView in my page but the problem is that the Header and the field or the cell contents are not aligned. In other words, my Cells or Fields are not aligned with the Header; they are little bit shifted to the right. Everything was aligned perfectly before I apply the JQuery Scrollable function and now I am not sure how to fix this. Can someone help? thanks Here is my code
<script src="../Scripts/jquery-1.8.1.min.js" type="text/javascript"></script> <script src="../Scripts/ScrollableGridViewPlugin_ASP.NetAJAXmin.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $('#<%=GV_Detail.ClientID %>').Scrollable({ ScrollHeight: 300, IsInUpdatePanel: true }); }); </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> <asp:UpdatePanel ID="up" runat="server"> <ContentTemplate> <asp:GridView ID="GV_Detail" runat="server" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="GV_Detail_DS"> <Columns> <asp:BoundField DataField="ContactName" HeaderText="Contact Name" /> <asp:BoundField DataField="City" HeaderText="City" /> <asp:BoundField DataField="Country" HeaderText="Country" /> </Columns> <FooterStyle BackColor="White" ForeColor="#000066" /> <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /> <RowStyle ForeColor="#000066" /> <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /> <SortedAscendingCellStyle BackColor="#F1F1F1" /> <SortedAscendingHeaderStyle BackColor="#007DBB" /> <SortedDescendingCellStyle BackColor="#CAC9C9" /> <SortedDescendingHeaderStyle BackColor="#00547E" /> </asp:GridView> <asp:SqlDataSource ID="GV_Detail_DS" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>" SelectCommand="SELECT contactname, city, country from my table"> </asp:SqlDataSource> </ContentTemplate> </asp:UpdatePanel> </div>anil.india
Contributor
2613 Points
453 Posts
Re: JQuery Scrollable GridView with Fixed Header in ASP.Net
Nov 22, 2012 03:51 PM|LINK
I think Microsoft's Data controls have nothing to do with third party plugins you are using. Better to discuss with this jQuery plugin originator.
Anyway, I found similar problem in use of your said plugin "ScrollableGridViewPlugin_ASP.NetAJAXmin.js" with UpdatePanel. Please refer this link http://www.aspsnippets.com/Articles/Scrollable-GridView-with-Fixed-Headers-inside-ASPNet-UpdatePanel-using-jQuery-Plugin.aspx
codepattern.net/blog ||@AnilAwadh
karinos57
Member
24 Points
108 Posts
Re: JQuery Scrollable GridView with Fixed Header in ASP.Net
Nov 22, 2012 07:40 PM|LINK
thanks
twlikol
Member
88 Points
20 Posts
Re: JQuery Scrollable GridView with Fixed Header in ASP.Net
Nov 23, 2012 05:36 AM|LINK
i wrote jQuery plug-in can do this! maybe you can try.
Supported Browsers
look the website: http://gridviewscroll.aspcity.idv.tw/
http://gridviewscroll.aspcity.idv.tw/
karinos57
Member
24 Points
108 Posts
Re: JQuery Scrollable GridView with Fixed Header in ASP.Net
Nov 30, 2012 10:59 PM|LINK
this is very cool man. Where can i download the plugin? I only see the scripts in the link
karinos57
Member
24 Points
108 Posts
Re: JQuery Scrollable GridView with Fixed Header in ASP.Net
Nov 30, 2012 11:00 PM|LINK
nevermind, i got it now. thanks man