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

Enter key to fire item command?

2 Answers 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RJ
Top achievements
Rank 1
RJ asked on 19 Aug 2014, 07:40 AM
Hi all,

I just want to ask on how can I call item command "Filter" on Normal mode and item command "PerformInsert" on Edit mode when Enter key is pressed? Also my page uses MasterPage which also adds problem to my task. Any feedback would be greatly appreciated.

Thanks in advance,
RJ

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 19 Aug 2014, 08:13 AM
Hi RJ,

I guess you want to filter and perform insert on Enter key press. For filtering you can set AutoPostBackOnFilter to true for the columns and to have the form submitted set KeyboardNavigationSettings->AllowSubmitOnEnter=true. Please take a look at the sample code:

ASPX:
<telerik:RadGrid ID="rgrdSample" runat="server" AllowFilteringByColumn="true" OnItemCommand="rgrdSample_ItemCommand". .>
    <MasterTableView DataKeyNames="OrderID" CommandItemDisplay="Top">      
        <Columns>         
            <telerik:GridBoundColumn UniqueName="OrderID" DataField="OrderID" HeaderText="OrderID" AutoPostBackOnFilter="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ShipCity" HeaderText="ShipCity" UniqueName="ShipCity">
            </telerik:GridBoundColumn>         
        </Columns>
    </MasterTableView>
    <ClientSettings AllowKeyboardNavigation="true">
        <KeyboardNavigationSettings AllowSubmitOnEnter="true" />
    </ClientSettings>
</telerik:RadGrid>

Thanks,
Princy
0
RJ
Top achievements
Rank 1
answered on 19 Aug 2014, 03:48 PM
Hi Princy,

Thanks for the reply but seems like
<KeyboardNavigationSettings AllowSubmitOnEnter="true" />
is not available on my grid.

Do you have javascript that can fire itemCommand?
Perhaps for Radcontrols Classic? 


Thanks again,
RJ
 
Tags
Grid
Asked by
RJ
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
RJ
Top achievements
Rank 1
Share this question
or