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

hide page scroll when focus is on Radgrid

1 Answer 69 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Kishor
Top achievements
Rank 2
Kishor asked on 18 Sep 2014, 11:22 AM
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

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 23 Sep 2014, 02:58 PM
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.

 
Tags
Upload (Obsolete)
Asked by
Kishor
Top achievements
Rank 2
Answers by
Pavlina
Telerik team
Share this question
or