I've search around the forum trying to find a way to navigate a grid only using the keyboard and I have found some solutions, but not all works.
So far I can focus on the grid and navigate between rows and pages, but I need a way to enter sorting and the filtermenu - I can't get the example from the forum with the FocusMenu function to work.
Note: I don't want the edit-form to be activated - that's the reason for the ItemCommand-event.
I'm also looking for a way to make the filtermenu focused automatically on page load and making the grid focused automatically when the users navigates to another page in the grid.
So far I can focus on the grid and navigate between rows and pages, but I need a way to enter sorting and the filtermenu - I can't get the example from the forum with the FocusMenu function to work.
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function FocusMenu(menu, eventArgs)
{
menu.get_items().getItem(0).get_linkElement().focus();
}
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadGrid
ID
=
"RadGridAxOrder"
runat
=
"server"
DataSourceID
=
"sdsAxOrderView"
AllowPaging
=
"True"
AllowSorting
=
"True"
AllowFilteringByColumn
=
"True"
GridLines
=
"None"
AutoGenerateColumns
=
"False"
onitemcommand
=
"RadGridAxOrder_ItemCommand"
onprerender
=
"RadGridAxOrder_PreRender"
>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
>
<
KeyboardNavigationSettings
FocusKey
=
"G"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataSourceID
=
"sdsAxOrderView"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ordreNr"
FilterControlAltText
=
"Filter ordreNr column"
HeaderText
=
"Ordrenr."
ReadOnly
=
"True"
SortExpression
=
"ordreNr"
UniqueName
=
"ordreNr"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ordreNavn"
FilterControlAltText
=
"Filter ordreNavn column"
HeaderText
=
"Ordrenavn"
SortExpression
=
"ordreNavn"
UniqueName
=
"ordreNavn"
>
</
telerik:GridBoundColumn
>
And so on
protected void RadGridAxOrder_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
e.Canceled = true;
}
}
protected void RadGridAxOrder_PreRender(object sender, EventArgs e)
{
RadGridAxOrder.FilterMenu.OnClientShown = "FocusMenu";
}
}
Note: I don't want the edit-form to be activated - that's the reason for the ItemCommand-event.
I'm also looking for a way to make the filtermenu focused automatically on page load and making the grid focused automatically when the users navigates to another page in the grid.