I hope I can explain this properly.
I have a page in ASP.net (3.5) containing a GridView. I have implemented jquery to freeze columns and headers of the GridView (the jquery I implemented can be found here: http://gridviewscroll.aspcity.idv.tw/).
Now, the frustrating part. Any control I place on the page, above the GridView maintains view state on post back. Any control following the GridView loses view state on post back.
<asp:TextBox ID="tbx_Value1" runat="server" />
<asp:TextBox ID="tbx_Value2" runat="server" />
<asp:GridView ID="gv_Data" runat="server" />
<asp:TextBox ID="tbx_Value3" runat="server" />
So, on post back the view state of tbx_Value1, tbx_Value2 and the GridView are retained, but the view state of tbx_ValueValue3 is lost. Setting EnableViewState="true"
does not improve the situation.
The JQuery download is called in the following javascript:
<script type="text/javascript">
var c = 0;
c = '<%=this.col %>';
$(document).ready(function() {
gridviewScroll(c);
});
function gridviewScroll(c) {
$('#<%=gv_Data.ClientID%>').gridviewScroll({
width: 1350,
height: 330,
freezesize: c,
arrowsize: 30,
varrowtopimg: "../../../images/arrowvt.png",
varrowbottomimg: "../../../images/arrowvb.png",
harrowleftimg: "../../../images/arrowhl.png",
harrowrightimg: "../../../images/arrowhr.png",
headerrowcount: 1
});
}
</script>
I am at a loss as to how to address this. I have moved my controls around, recreated the page, rebuilt the application. All of this returns the same result. So, I can only assume it has something to do with the javascript (or jquery download I am using). Perhaps when it is applied in the page life cycle? Javascript/jquery is not my strong point, so any help would be greatly appreciated.
Thank you.