Hi,
We are tring to customize the key-press behaviors on a RadGrid. The example of the RadGrid and the JavaScript code shown below. What we want is to cancel scrolling and make the next cell in edit mode when a user press the arrow down key. Is that any way to allow me to do so? Please help!
Anyway, I knew that we can use the paging stuff to avoid scrolling problem. However, we do want to have scrolling function on the Grid.
We are tring to customize the key-press behaviors on a RadGrid. The example of the RadGrid and the JavaScript code shown below. What we want is to cancel scrolling and make the next cell in edit mode when a user press the arrow down key. Is that any way to allow me to do so? Please help!
<
telerik:RadGrid
runat
=
"server"
ID
=
"radgrid"
...>
<
MasterTableView
TableLayout
=
"Fixed"
>
<
Columns
>...</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
<
ClientEvents
OnKeyPress
=
"keyPress"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
oldScrollTop = 0;
function keyPress(sender, args) {
var keyCode = args.get_keyCode();
switch (keyCode) {
//If Down Key
case 40:
//set the scrolling position in propor
var scrollArea = document.getElementById(sender.get_element().id + "_GridData");
//try to cancel the scrolling and it's not working
//sender.ClientSettings.AllowScroll = false;
//try to set the scroll-area top position as same as the top of the first row,
//but scrollArea.scrollTop always be assigned to 53
scrollArea.scrollTop = 0;
break;
}
}
Anyway, I knew that we can use the paging stuff to avoid scrolling problem. However, we do want to have scrolling function on the Grid.