I'm using a JQuery plugin called ScrollableGridViewPlugin by Mudassar Khan.
In the Document.Ready function I declare the max ScrollHeight and the fact that the GridView is inside an UpdatePanel like this:
<script type="text/javascript">
$(document).ready(function () {
$('#<%=GridView1.ClientID %>').Scrollable({
ScrollHeight: 300,
IsInUpdatePanel: true
});
});
</script>
The action I want to achieve is to display my GridView when you press on a button. This is my ASP code:
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="ErrorLogWrap">
<div class="Content">
<asp:Button ID="btn" runat="server" OnClick="btn_Click" Text="Show Gridview" />
<div runat="server" ID="divGrv" visible="false" style="overflow: auto; width: 100%">
<asp:GridView runat="server" ID="GridView1">
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
Without the UpdatePanel this piece of code works perfectly but with it then it seems to completely ignore it. I'm really bad in JQuery and my hunch is that the document.ready doesn't get executed in an Ansycnhronous PostBack?
Any ideas? Petar
Found the solution:
Jquery:
ASP: