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

TreeView scrolling with pressing spacebar

1 Answer 47 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
mirang
Top achievements
Rank 1
mirang asked on 23 Feb 2012, 02:39 PM
I am having a radtreeview with checkboxes. I have around 5000 nodes. Now the check and uncheck works fine with enter key and mouse click. It also works with spacebar key. But when there is a scrollbar in the treeview the treeview is scrolling down on pressing spacebar key. Is this a default behavior, and any ways we can supress this.

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 27 Feb 2012, 02:48 PM
Hi Mirang,

This is a browser inconsistence. Different browsers interpret the space key in different ways. For instance, when you try this in Firefox, the space key doesn't scroll to the bottom.

To cancel this, you can try the following approach - add the following to the OnClientLoad event of the treeview:
function clientLoad(sender) {
    $telerik.$(sender.get_element()).keydown(function(e) {
        if (e.keyCode == 32)
            e.preventDefault();
    });
}

 
Kind regards,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
TreeView
Asked by
mirang
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or