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

Delete row with a button

6 Answers 74 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Frederic
Top achievements
Rank 1
Frederic asked on 12 Dec 2011, 11:47 AM
Hello,

When I select a row and press delete the row is removed.
How can I reuse this command whit a button so that the delete options is more obvious for the user?

Thank you

6 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 12 Dec 2011, 11:57 AM
Hello Frederic,

Please take a look at our demos and online documentation for a reference.
 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Frederic
Top achievements
Rank 1
answered on 12 Dec 2011, 12:36 PM
Hello,

I tryied the code below but it seems not to be working. Is it correct to use the RaGrid delete command for the treelistview?
thanks
<telerik:RadButton Content="Delete" Margin="15,0,0,0" Command="telerikGrid:RadGridViewCommands.Delete" CommandTarget="{Binding ElementName=_pagesTreeList}"/>
 
<telerik:RadTreeListView x:Name="_pagesTreeList" CanUserDeleteRows="True" IsDragDropEnabled="True" AllowDrop="True" IsDragTooltipEnabled="False" DragCueItemTemplate="{StaticResource DragCueTreeList}" ItemsSource="{Binding PagesHierarchy, Mode=TwoWay}" AutoGenerateColumns="False" d:LayoutOverrides="Width, Height">
            
0
Maya
Telerik team
answered on 12 Dec 2011, 12:49 PM
Hi Frederic,

There is no problem to use Delete command with RadTreeListView. Could you verify whether you have the required references added and the uri is correctly defined in your application ? 

Best wishes,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Frederic
Top achievements
Rank 1
answered on 12 Dec 2011, 01:23 PM
I have the following uri defined :

xmlns

 

 

:telerik="http://schemas.telerik.com/2008/xaml/presentation"

 

xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"


and the following references:
Telerik.Windows.Controls
Telerik.Windows.Controls.GridView
Telerik.Windows.Controls.Input
Telerik.Windows.Data
Telerik.Windows.Themes.Expression_Dark

The delete key works but not the button
0
Accepted
Maya
Telerik team
answered on 12 Dec 2011, 01:27 PM
Hi Frederic,

Could you try to initialize the command before InitializeComponent() method:

public MainPage()
       {
           ICommand deleteCommand = RadGridViewCommands.Delete;
  
           InitializeComponent();
  
       }

 

Best wishes,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Frederic
Top achievements
Rank 1
answered on 12 Dec 2011, 01:39 PM
Thank you it works now!
Tags
TreeListView
Asked by
Frederic
Top achievements
Rank 1
Answers by
Maya
Telerik team
Frederic
Top achievements
Rank 1
Share this question
or