This is a migrated thread and some comments may be shown as answers.

maintain scroll position

3 Answers 269 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Layo
Top achievements
Rank 1
Layo asked on 27 Mar 2013, 08:10 PM
Hi everyone

I have a problem with the grid on the third level.
has a scroll, but I can not make it maintain the position after the postback.
i added <Scrolling put AllowScroll="True" SaveScrollPosition="True"> but does not work.

in the following  image shows the scroll to which I refer.



3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Mar 2013, 04:39 AM
Hi,

Check the following forum thread which discussed similar scenario.
Maintain Scroll position

Thanks,
Shinu
0
Layo
Top achievements
Rank 1
answered on 28 Mar 2013, 12:34 PM
Thanks for your answer ..
I have a problem with that kind of function, because it use SCROLLTOP, and that value  always is zero.
0
Layo
Top achievements
Rank 1
answered on 04 Apr 2013, 02:26 PM
I solved with only javasctipt.
in the event OnScroll put call a function who save de position; onscroll='OnScrollDiv (this)'

The function

        function OnScrollDiv(obj) {

            document.getElementById("scroll").value = obj.scrollLeft;
        }

Then, on each onload in the page, call a function who assign the postion that has been saved previously.
<body class="BODY"  onload="assignScrollPosition();">

 function assignScrollPosition() {
            if (document.getElementById("divTerceraGrilla") != null) {
                var divToUpdate = document.getElementById("divTerceraGrilla");
                    divToUpdate.scrollLeft = document.getElementById("scroll").value;
            }

        }


I hope it helps someone
Tags
Grid
Asked by
Layo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Layo
Top achievements
Rank 1
Share this question
or