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

EventContainer height based on content

3 Answers 145 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 10 Sep 2014, 08:34 AM
Hello!
What I`m trying to do is to increase height of item container in GanttView when content is too long for one line. I edited EventContainer Template to add some wrapping and increase MaxHeight of inner TextBlock, but it seems that row height doesn`t change because of event containers.
Maybe I`m missing something simple here. Is there a way to make row height grow when some EventContainer in that row grows?
I attach a screenshot of the result I get right now for reference.

3 Answers, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 12 Sep 2014, 12:50 PM
Hi Alexander,

In order to change the row height of the RadGanttView we need to change the MinHeight of all the CellContainers so there is no discrepancy in the heights when a cell is in edit mode or when it has a set DataTemplate for it. Also in order for the RelationContainers to appear correctly positioned in the middle of the EventContainers we need to change their Margin accordingly ( = the new MinHeight/2 ).

Please find attached a sample project demonstrating this approach. Note that the project uses Implicit Styles.
What I did is to:
1) Change the EventContainer ControlTemplate to set the txtBlock.TextWrapping to Wrap  so that the text can stretch.
2) Change the SimpleCellContainerStyle, CellContainerStyle, CellEditingContainerStyle and SimpleTreeCellContainerStyle to set the MinHeight to 35.
3) Change the RelationContainerStyle and DragRelationSlotContainerStyle to modify the Margin and set the Top and Left margin to MinHeight/2.

Hopefully this helps and is suitable for your scenario.

Regards,
Polya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Alexander
Top achievements
Rank 1
answered on 15 Sep 2014, 08:29 AM
Thank you, Polya.
As I understand it`s not possible to make rows higher only if EventContainer requires more space but leave it default height otherwise. And all rows must be of the same height at that too.

In my scenario there`s no real scence in increasing row height by default because most of the EventContainers have enough space. Just that sometimes there are several of them that have more content and less horizontal space so wrapping is required.
0
Polya
Telerik team
answered on 15 Sep 2014, 10:22 AM
Hi Alexander,

Dynamic row height is not supported in the current implementation of the RadGanttView. The proposed solution will modify the row height for all the rows.
In the EventContainer tooltip the whole GanttTask title is displayed so it can be visible even if it is not fully shown in the EventContainer itself.

Regards,
Polya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GanttView
Asked by
Alexander
Top achievements
Rank 1
Answers by
Polya
Telerik team
Alexander
Top achievements
Rank 1
Share this question
or