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

Delete selected row using keyboard

4 Answers 18 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryann
Top achievements
Rank 1
Ryann asked on 15 Oct 2013, 01:19 PM
Hi,
Is there a way to delete the selected row using keyboard delete.?

Thanks,
Ryann. 

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 15 Oct 2013, 01:25 PM
Hi Ryann,

Please try the following code snippet.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server". . .>
    <MasterTableView. . .>
        <Columns>
          . . . .
        </Columns>
    </MasterTableView>
    <ClientSettings Scrolling-AllowScroll="true" AllowKeyboardNavigation="true" Selecting-AllowRowSelect="true"
        ClientEvents-OnKeyPress="keyPress">
    </ClientSettings>
</telerik:RadGrid>

JS:
<script type="text/javascript">
    function keyPress(sender, eventArgs) {
        if (eventArgs.get_keyCode() == 46) {
            $find("<%= RadGrid1.ClientID %>")._deletedItems = [];
        }
    }  
</script>

Thanks,
Shinu
0
Daniel
Telerik team
answered on 18 Oct 2013, 09:01 AM
Hello Ryann,

This functionality is available out of the box. Please see the following demo:
RadGrid keyboard navigation

Regards,
Daniel
Telerik
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 the blog feed now.
0
Marcel
Top achievements
Rank 1
answered on 29 Apr 2014, 08:02 AM
Hello Daniel,

I am looking for the same functionality. In the original post Ryann wanted to use the delete key. The link you provided does not show how to enable the Delete key. The property DeleteActiveRow of ClientSettings.KeyboardNavigationSettings suggest the grid can support the delete key.

Am I missing something?

Regards,

Marcel
0
Princy
Top achievements
Rank 1
answered on 29 Apr 2014, 08:22 AM
Hi Marcel,

Please try the method mentioned in the following forum to handle delete on delete key-press.
http://www.telerik.com/forums/delete-raw-from-rad-grid-on-delete-key-pressed#QMjUT-abCk-KjN0JCFHFZA

Thanks,
Princy
Tags
Grid
Asked by
Ryann
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Daniel
Telerik team
Marcel
Top achievements
Rank 1
Princy
Top achievements
Rank 1
Share this question
or