Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
580
Not able to Navigate Pagination thru Tab Key
posted

Hi,

 

I am using the WDG in one of my application. Application demand the navigation thru tab key.

Surprisingly when focus is on grid and user press the ‘Tab’ key, focus navigate to the scrollbar, if it is available and again the user press the ‘Tab’ key, focus navigate to the another control. It is not going to the Pagination panel.

I am using the default pagination property in my application.

Can anyone help me, how we can stop/navigate the pagination panel thru ‘Tab’ key?

Thanks & Regards,

Yogesh Shah

  • 20255
    Offline posted

    Hello Yogesh,

     Thank you for your post!

     I have create a sample where on tab press you iterate through WebDataGrid pages. The specific here is that, when you press tab, you will lose the focus of the grid and will continue to the next control on the page (or to the scrollbar of the grid), so in order to skip that I just cancel the event, after I'm finished with the active page changing.

     Code snippet:

    <script type="text/javascript">
            function KeyDown(sender, eventArgs) {
                var keyCode = eventArgs.get_browserEvent().keyCode;
                if (keyCode == 9) {

                    var pagingBehavior = sender.get_behaviors().get_paging();
                    if (pagingBehavior.get_pageIndex() == pagingBehavior.get_pageCount() - 1) {
                        pagingBehavior.set_pageIndex(0);
                    } else {
                        pagingBehavior.set_pageIndex(pagingBehavior.get_pageIndex() + 1);
                    }

                    eventArgs.set_cancel(true)
                }
            }
        script>

     If you have any further questions do not hesitate to contact me!

    SetActivePagionationPanel.zip