Default filter menu pressing enter key on radgrid gridtemplatecolumn

4 posts, 0 answers
  1. archimede
    archimede avatar
    103 posts
    Member since:
    Jul 2006

    Posted 12 Nov 2012 Link to this post

    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.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Nov 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. archimede
    archimede avatar
    103 posts
    Member since:
    Jul 2006

    Posted 12 Nov 2012 Link to this post

    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).
  5. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 15 Nov 2012 Link to this post

    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.
Back to Top