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

added Items in Children not show when InitialExpandBehavior is used

2 Answers 84 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 30 Oct 2014, 05:00 PM
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 https://drive.google.com/file/d/0Bw_pUE-LqMWVbjZGWHJ5ZlFKX1U/view?usp=sharing
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 Answers, 1 is accepted

Sort by
0
Accepted
Polya
Telerik team
answered on 03 Nov 2014, 03:31 PM
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.

Regards,
Polya
Telerik
 

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.

 
0
Julien
Top achievements
Rank 1
answered on 03 Nov 2014, 04:11 PM
OK the solution works perfectly

Thanks for your help
Tags
GanttView
Asked by
Julien
Top achievements
Rank 1
Answers by
Polya
Telerik team
Julien
Top achievements
Rank 1
Share this question
or