hide page scroll when focus is on Radgrid

Thread is closed for posting
2 posts, 0 answers
  1. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 18 Sep 2014 Link to this post

    hello

    I have webpart containing radgrid with scroll.
    when i scroll grid , page also scroll

    so i want to do is - hide disable or hide page scroll when focus is on radgrid and enable scroll when focus is out of radgrid

    below is attached image

    please help.

    thanks
    Kishor
  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 23 Sep 2014 Link to this post

    Hello Kishor,

    The only when to hide the browser scroll while scrolling the grid is by handling Grid OnScroll client-side event and use the Javascript code snippet below:
    <script type="text/javascript">
            var a = 0;
            function OnScroll(sender, args) {
                clearTimeout(a);
                document.documentElement.style.overflow = "hidden";
                $find("RadGrid1").repaint();
                a = setTimeout(function () {
                    document.documentElement.style.overflow = "";
                    $find("RadGrid1").repaint();
                }, 1000);
     
            }
        </script>

    I have also attached a sample project for reference.

    Regards,
    Pavlina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top