added Items in Children not show when InitialExpandBehavior is used

3 posts, 1 answers
  1. Julien
    Julien avatar
    20 posts
    Member since:
    Oct 2013

    Posted 30 Oct 2014 Link to this post

    Hello everybody,

    I have a probleme with my GanttView when I add event to an event that doesn't have children at beginning, when an InitialExpandBehavior is used to keep event collapsed.
    I recreate this bug in a small example you can find here
    Reproduction in this project :
    - at beggining, 2 event are generated : "phase 1" and "phase 2", and an event "evt phase 1" is added to children of "phase 1"
    - I have an InitialExpandBehavior which return false in ShouldExpandItemByDefault in order to all items are collapsed
    - I Have 2 button : "Add event to phase 1" which add an event in children of "phase 1" and "Add event to phase 2" which add an event in children of "phase 2"
    - click on "Add event to phase 1" is OK, the event is added
    - click on "Add event to phase 2" is KO, the event is added but the view is not refresh
    If I remove the expandBehavior, the two buttons are OK.

    Can you investigate ? Have you a workaround if correction is complicated ?

    Thanks for your Help

    PS : sorry for my english
  2. Answer
    Polya avatar
    190 posts

    Posted 03 Nov 2014 Link to this post

    Hello Julien,

    This issue is related to another known problem at our side. It is logged in our Feedback Portal where you can track its status.
    As a workaround I suggest modifying the ExpandBehavior to collapse items only if these items have children:
    public bool ShouldExpandItemByDefault(Telerik.Windows.Core.HierarchicalItem item)
        var sourceItem = item.SourceItem as GanttTask;
        // Collapse Items only if the SourceItem(GanttTask) has children.
        if (sourceItem != null && sourceItem.Children.Count > 0)
            return false;
        return true;

    Hopefully this helps and is suitable for your scenario.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
  4. Julien
    Julien avatar
    20 posts
    Member since:
    Oct 2013

    Posted 03 Nov 2014 in reply to Polya Link to this post

    OK the solution works perfectly

    Thanks for your help
Back to Top