EventContainer height based on content

4 posts, 0 answers
  1. Alexander
    Alexander avatar
    11 posts
    Member since:
    Aug 2011

    Posted 10 Sep 2014 Link to this post

    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.
  2. Polya
    Admin
    Polya avatar
    200 posts

    Posted 12 Sep 2014 Link to this post

    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.
     
  3. DevCraft banner
  4. Alexander
    Alexander avatar
    11 posts
    Member since:
    Aug 2011

    Posted 15 Sep 2014 in reply to Polya Link to this post

    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.
  5. Polya
    Admin
    Polya avatar
    200 posts

    Posted 15 Sep 2014 Link to this post

    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.
     
Back to Top