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

Default filter menu pressing enter key on radgrid gridtemplatecolumn

3 Answers 348 Views
Grid
This is a migrated thread and some comments may be shown as answers.
archimede
Top achievements
Rank 1
archimede asked on 12 Nov 2012, 08:39 AM
Good day,

we have a working radgrid that shows an unusual behavior.
The grid works as expected, but after entering editmode, pressing the enter key alone will display the default radgrid filter menu, on the top left corner of the containing div (where there's no grid columns)

We've noticed that this seems related to control focus: after sorting the grid with a column header click, pressing enter after edit mode, will exit edit mode as expected, without displaying the default filter menu, and updating the record.

We'd like to know where and how this filter menu enter key is listened to, especially since we have a different grid, where this does not happen (it's in a page with a form view, while the troublesome one is just a grid).

Do note that we've successfully 'solved' this by intercepting the FilterMenuShowing event, but we believe there's a behavior problem that we'd like to pinpoint.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Nov 2012, 09:09 AM
Hi,
I suppose this issue is because the filter button of the RadGrid column turns out to be the first button rendered in the form the grid resides in. That is why it is set as the form's default (submit) button. In order to work around this, you can declare an invisible inactive button and set it to be the default one.
aspx:
<form id="form1" defaultbutton="Button2" runat="server">
<asp:Button ID="Button2" runat="server" Text="" style="display: none;" OnClientClick="return false;" />

Thanks,
Princy.
0
archimede
Top achievements
Rank 1
answered on 12 Nov 2012, 09:55 AM
Thanks for your support, however there might be a misunderstanding: what appears is not the 'filtering row', but instead the 'javascript filtering menu', the one that allows customizing of the filtering behavior (remove, equal to, not equal to, etc.).
It is unclear why this menu appears in the first place, especially when focus (cursor) is on a valid gridtemplatecolumn field and blinking, and enter is pressed.

So we'd like to know where and how this filter menu enter key is listened to, especially since we have a different grid, where this does not happen (it's in a page with a form view, while the troublesome one is just a grid).
0
Eyup
Telerik team
answered on 15 Nov 2012, 12:00 PM
Hi Francesco,

As Princy has stated in his comment, the first button inside the grid happens to be the default button of the form, therefore, getting clicked upon pressing Enter key on an input control.

You will have to either continue to use your own approach to prevent the menu pop-up, or the alternative approach suggested by Princy, or enable the keyboard navigation of your RadGrid:
<ClientSettings AllowKeyboardNavigation="true">
    <KeyboardNavigationSettings AllowSubmitOnEnter="true" EnableKeyboardShortcuts="true" />
</ClientSettings>

I hope this will prove helpful.

Greetings,
Eyup
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
Grid
Asked by
archimede
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
archimede
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or