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

SelectionUnit and CanUserDeleteRows

1 Answer 62 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 07 Jan 2011, 08:12 PM
Is there a way to have the SelectionUnit=Cell and the CanUserDeleteRows still enabled?  It appears that the command enabling checks to see what the selection unit is and whether the user can delete rows.

I am going to override the Deleting event and will handle the deleting myself, I am just looking for the delete key event that excludes it happening in a cell.

Thanks

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 10 Jan 2011, 09:55 AM
Hello Greg,

This behavior is by design - once you set SelectionUnit to "Cell" the deleting functionality is disabled. However, what you can do is to handle the PreviewKeyDownEvent and implement your custom logic when the pressed key is Del:

this.RadTreeListView1.AddHandler(RadTreeListView.PreviewKeyDownEvent, new KeyEventHandler(OnKeyDown),true);    
 
private void OnKeyDown(object sender, KeyEventArgs e)
{
    if(e.Key == Key.Delete)
    {
        MessageBox.Show("You are deleting!");
    }
}

 

Best wishes,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
TreeListView
Asked by
Greg
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or