Collapse Sub-Tasks By Default

10 posts, 1 answers
  1. Prolay
    Prolay avatar
    27 posts
    Member since:
    Nov 2012

    Posted 14 Nov 2012 Link to this post

    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
  2. Answer
    Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 19 Nov 2012 Link to this post

    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.

  3. DevCraft banner
  4. Prolay
    Prolay avatar
    27 posts
    Member since:
    Nov 2012

    Posted 21 Nov 2012 Link to this post

    Hi Ivo,

    Thanks! it has worked for me.


    Regards,
    Prolay
  5. Anne Lyon
    Anne Lyon avatar
    87 posts
    Member since:
    Jan 2010

    Posted 07 Jan 2013 Link to this post

    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?
  6. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 07 Jan 2013 Link to this post

    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.

  7. Anne Lyon
    Anne Lyon avatar
    87 posts
    Member since:
    Jan 2010

    Posted 07 Jan 2013 Link to this post

    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!
  8. Anne Lyon
    Anne Lyon avatar
    87 posts
    Member since:
    Jan 2010

    Posted 07 Jan 2013 Link to this post

    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
  9. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 07 Jan 2013 Link to this post

    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.

  10. Anne Lyon
    Anne Lyon avatar
    87 posts
    Member since:
    Jan 2010

    Posted 08 Jan 2013 Link to this post

    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
  11. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 11 Jan 2013 Link to this post

    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.

Back to Top
DevCraft banner