AfterLabelEdit and EndEdit

2 posts, 0 answers
  1. Marek
    Marek avatar
    48 posts
    Member since:
    Aug 2005

    Posted 04 Sep 2007 Link to this post

    We want to extend the functionality of RadTreeView and have therefore done something like this: 

    public class DerivedTree : RadTreeView
      public DerivedTree()
        this.AllowEdit = true;
        this.AfterLabelEdit += new AfterLabelEditHandler  (DerivedTree_AfterLabelEdit);

    We then have two problems.  The first is that we get an obsolete warning about using AfterLabelEdit and using EndEdit instead.

    The problem is that EndEdit is just a method and not virtual and as far as I could see and there is no equivalent OnEndEdit event.  How should we use this functionality correctly?

    The second problem is that when we use this control all the [hot] feedback and node selection indication does not appear any more.  What is the problem and how can we correct it.

    Best regards


  2. Jordan
    Jordan avatar
    547 posts

    Posted 05 Sep 2007 Link to this post

    Hi Marek,

    We are sorry that the obsolete events cause such confusion. However we believe this is for good as we are
    implementing a framework for editor support in RadTreeView. We will be happy if you work with us towards a stable and extensible RadTreeView.

    Regarding your issues with deriving form RadTreeView - they all have an easy solution as demonstrated below:

    public class DerivedTreeView : RadTreeView 
            public DerivedTreeView() : base() 
                this.AllowEdit = true
                this.Edited += new EventHandler(DerivedTreeView_Edited); 
                this.ValueValidating += new CancelEventHandler(DerivedTreeView_ValueValidating); 
            protected override void CreateChildItems(Telerik.WinControls.RadElement parent) 
                //set the theme to use 
                this.ThemeName = "ControlDefault"
            //return the RadTreeView type name to enable original themes 
            public override string ThemeClassName 
                    return typeof(RadTreeView).FullName; 
            void DerivedTreeView_ValueValidating(object sender, CancelEventArgs e) 
                if ((this.ActiveEditor.Value as string).Length > 7) 
                    e.Cancel = true
            void DerivedTreeView_Edited(object sender, EventArgs e) 
                System.Diagnostics.Debug.WriteLine("New value: " + this.SelectedNode.Text); 

    Thank you for your cooperation.

    All the best,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft R3 2016 release webinar banner
Back to Top