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

CellEditEnded event does not fire for child node of different type

4 Answers 63 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Darlene
Top achievements
Rank 1
Darlene asked on 15 Feb 2012, 04:35 PM
Hi,

I'm trying to set up a relatively simple tree view.  It just so happens that I have two different data types as nodes in this tree view and that seems to cause some unexpected behaviour.  In another thread, it was determined that the background border wouldn't disappear if we moved off the cell.  In this thread, I note that the CellEditEnded event does not fire for child nodes.  Below is an outline of a solution that reproduces the problem.  Use the debugger to catch when CellEditEnded event fires.  Several other events seem to only also work on parent nodes.  How can I make these events fire for child nodes when they are also of a different type than the parent node?

Thank you

View:
<telerik:RadTreeListView ItemsSource="{Binding ParentItems}" AutoGenerateColumns="False" ShowColumnHeaders="False" ShowGroupPanel="False" HorizontalGridLinesBrush="{x:Null}"
                                 RowIndicatorVisibility="Collapsed" AutoExpandItems="True" CellEditEnded="RadTreeListView_CellEditEnded" >
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" />
            </telerik:RadTreeListView.Columns>
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
        </telerik:RadTreeListView>

Code Behind:
public MainPage()
        {
            InitializeComponent();
            this.DataContext = new Model();
        }
 
        private void RadTreeListView_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
        {
            // Insert breakpoint here
        }

Model:

public class Model
    {
        public RadObservableCollection<Parent> ParentItems { get; private set; }
 
        public Model()
        {
            ParentItems = new RadObservableCollection<Parent>();
 
            var parent1 = new Parent { Name = "Parent1" };
            parent1.Children.AddRange(new Child[] { new Child("Child1"), new Child("Child2"), new Child("Child3") });
            ParentItems.Add(parent1);
 
            var parent2 = new Parent { Name = "Parent2" };
            parent2.Children.AddRange(new Child[] { new Child("Child4"), new Child("Child5") });
            ParentItems.Add(parent2);
 
            var parent3 = new Parent { Name = "Parent3" };
            parent3.Children.AddRange(new Child[] { new Child("Child6") });
            ParentItems.Add(parent3);
        }
    }
 
    public class Parent
    {
        public string Name { get; set; }
        public RadObservableCollection<Child> Children { get; private set; }
 
        public Parent()
        {
            Children = new RadObservableCollection<Child>();
        }
    }
 
    public class Child
    {
        public string Name { get; set; }
 
        public Child(string name)
        {
            Name = name;
        }
    }

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 16 Feb 2012, 02:58 PM
Hello,

 I have tested this functionality with the latest internal build and the event is fired for the child node as well. What version do you use?

All the best,
Didie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Darlene
Top achievements
Rank 1
answered on 16 Feb 2012, 03:50 PM
Hi Didie!

I'm using version 2011.3.1220.1040 or Q3 2011.
0
Dimitrina
Telerik team
answered on 16 Feb 2012, 03:54 PM
Hello,

 This confirms that the problem was resolved after the Service Pack was released. Please download the assemblies from the latest internal build and use them. 

Greetings,
Didie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Darlene
Top achievements
Rank 1
answered on 16 Feb 2012, 08:09 PM
Yep, what impeccible timing.  Fixed in Q1 2012.  Thanks!!
Tags
TreeListView
Asked by
Darlene
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Darlene
Top achievements
Rank 1
Share this question
or