Delete row with a button

7 posts, 1 answers
  1. Frederic
    Frederic avatar
    16 posts
    Member since:
    Aug 2011

    Posted 12 Dec 2011 Link to this post

    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
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 12 Dec 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Frederic
    Frederic avatar
    16 posts
    Member since:
    Aug 2011

    Posted 12 Dec 2011 Link to this post

    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">
                
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 12 Dec 2011 Link to this post

    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 >>

  6. Frederic
    Frederic avatar
    16 posts
    Member since:
    Aug 2011

    Posted 12 Dec 2011 Link to this post

    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
  7. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 12 Dec 2011 Link to this post

    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 >>

  8. Frederic
    Frederic avatar
    16 posts
    Member since:
    Aug 2011

    Posted 12 Dec 2011 Link to this post

    Thank you it works now!
Back to Top
DevCraft banner