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

TreeCellContainer image for tasks without children

3 Answers 40 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
AdrianG
Top achievements
Rank 1
AdrianG asked on 24 Oct 2015, 11:27 AM

Hi

This is probably a simple thing to achieve but I'm struggling to come up with the solution!

For tasks without children there is currently no expand/collapse image displayed in the tree cell as you would expect. However, for tasks without children at level 1 would it be possible to display an image - for example a simple bullet-point style image?

Many thanks

Adrian

3 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 28 Oct 2015, 12:49 PM
Hi Adrian,

Thank you for contacting us.

Yes you are correct the "Expand/Collapse" icon is only visible in the TreeCellContainer if that task has child task objects. In order to change this default behavior there are multiple approaches that could be used for example:
  • Edit the control's Theme, find the Style and Template of the TreeCellContainer and edit the Path with x:Name="PART_ExpandCollapseVisual"
  • A simple way that would not require the customization of the control's theme is to create a custom CellTemplate for the TreeColumnDefinition and in that DataTemplate using custom IValueConverter show or hide your custom "bullet-point" element. You can use the CellInfo.OriginalDataItem.CanExpand value to determine if the current GanttTask contains child elements.

I edited the "CellTemplateBasedOnType" SDK example project located in our GitHub repository in such a way that it illustrates the above described approach, hope this is helpful. You can find the edited project attached to my response.

If we can be of any further assistance do not hesitate to contact us again.

Regards,
Vladi
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
AdrianG
Top achievements
Rank 1
answered on 28 Oct 2015, 05:05 PM

Thanks for this Vladi.

Is there any way I can display the bullet-point icon in the same part of the TreeCellContainer where the expand/collapse icon would normally go? Your example puts the image with the text of the Title which is not quite what I'm after. The attached mock-up might help to illustrate what I mean.

Many thanks

Adrian

0
Vladi
Telerik team
answered on 29 Oct 2015, 01:03 PM
Hello Adrian,

Thank you for clearing the desired behavior.

By design in the RadGanttView control a GanttTask object can have any number of child GanttTask objects which respectively could have their own children tasks etc. This way you could achieve a multiple level of tasks structure. In order to separate (visually) each "level" of tasks the position (left offset) of the DataTemplate of each task is dynamically calculated in the source code of the control. Because this implementation is internal for the control changing it is not a simple task and has not been fully tested.

Currently we do not have an example project which demonstrates how to change this behavior of the nested tasks in the control. We will do our best to created such an example and add it to our SDK repository located at GitHub.

If you have any other questions, let us know.

Regards,
Vladi
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GanttView
Asked by
AdrianG
Top achievements
Rank 1
Answers by
Vladi
Telerik team
AdrianG
Top achievements
Rank 1
Share this question
or