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

Collapse Sub-Tasks By Default

9 Answers 117 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Prolay
Top achievements
Rank 1
Prolay asked on 14 Nov 2012, 09:52 AM
I have a requirement wherein I have to collapse the sub-tasks by default. Can anyone help me on this.

I am using this column type to set the display in parent child format.

<telerik:TreeColumnDefinition >
    <telerik:TreeColumnDefinition.CellTemplate>
        <DataTemplate>
        </DataTemplate>
    </telerik:TreeColumnDefinition.CellTemplate>
</telerik:TreeColumnDefinition>



Thanks and Regards

9 Answers, 1 is accepted

Sort by
0
Accepted
Ivo
Telerik team
answered on 19 Nov 2012, 11:47 AM
Hi Prolay,

I would suggest you to use the InitialExpandBehavior property of the RadGanttView. Setting it to "Expand to level 1" will do the trick into your case.

Regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Prolay
Top achievements
Rank 1
answered on 21 Nov 2012, 01:49 PM
Hi Ivo,

Thanks! it has worked for me.


Regards,
Prolay
0
Anne Lyon
Top achievements
Rank 1
answered on 07 Jan 2013, 12:23 PM
Would you be so kind and give me some example code in C#? I have tried:
myRadGanttView.InitialExpandBehavior.ShouldExpandItemByDefault = false;
But this syntax is not valid.
How do I set this property?
0
Ivo
Telerik team
answered on 07 Jan 2013, 12:44 PM
Hi Anne,

Initializing a new instance of InitialExpandBehavior and setting its ExpandToLevel to 0 will do the trick. Here is sample code:
var initialExpandBehavior = new Telerik.Windows.Controls.Scheduling.InitialExpandBehavior();
initialExpandBehavior.ExpandToLevel = 0
this.ganttView.InitialExpandBehavior = initialExpandBehavior;

All the best,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Anne Lyon
Top achievements
Rank 1
answered on 07 Jan 2013, 12:47 PM
Hi Ivo,
Thank you for the super-quick response. As ever I am impressed with the quality and efficiency of the Telerik team, you make it so worthwhile to be a Telerik user!
0
Anne Lyon
Top achievements
Rank 1
answered on 07 Jan 2013, 01:20 PM
One more thing:
In order for me to find the InitialExpandBehavior property I had to upgrade my Telerik project from 2012.2.607 to version 2012.3.1224. Without doing anything else in my code other than adding the 3 lines you suggested, I found that the whole left pane/tasktree and the header bars now are gone! Have I done anything wrong here? I have attached a screen shot.

regards,
Anne
0
Ivo
Telerik team
answered on 07 Jan 2013, 03:47 PM
Hi Anne,

The InitialExpandBehavior was introduced with the 2012.3.1129 (Q3 SP1) version. The version you mentioned is an internal build so it is not fully tested and should be used for test purposes only. Can you try with the latest official release - 2012.3.1129 (Q3 SP1)? If the issue persists send us the xaml declaration of your RadGanttView, so we will be able to investigate it.

Greetings,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Anne Lyon
Top achievements
Rank 1
answered on 08 Jan 2013, 08:54 AM
Hi Ivo,
Thanks for wanting to look into this!

I have opened a support ticket, stripped down my project to a minimum and made 2 zipped demos, one with version2012.2.607 and one with version 2012.3.1129. Hope you will find out what is wrong.

regards,
Anne Lyon
0
Ivo
Telerik team
answered on 11 Jan 2013, 09:09 AM
Hi Anne,

I am copying the reply from your support ticket.

Thank you for contacting us.

We've made a change in the GanttView control, so now the tree with the tasks is not shown by default.
Please check
here and here for more details on this.

All the best,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GanttView
Asked by
Prolay
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Prolay
Top achievements
Rank 1
Anne Lyon
Top achievements
Rank 1
Share this question
or