2 posts, 0 answers
  1. Martin
    Martin avatar
    2 posts
    Member since:
    Mar 2015

    Posted 21 Nov 2015 Link to this post

    Hello there,

    I got a little problem Binding MinHeight and Height of DragResizeSlotHighlightContainer to a Property of a GanttTask.

    So for the EventContainer everything works fine, I solved it this way:

    <Style TargetType="telerik:EventContainer" BasedOn="{StaticResource EventContainerStyle}">
       <Setter Property="Background" Value="{Binding OriginalEvent.Background}"/>
       <Setter Property="MinHeight" Value="{Binding OriginalEvent.Height}"/>
       <Setter Property="Height" Value="{Binding OriginalEvent.Height}"/>

    But for DragResizeSlotHighlightContainer it doesn't work getting OriginalEvent.Height to set MinHeight...

    <Style TargetType="telerik:DragResizeSlotHighlightContainer"
       BasedOn="{StaticResource  DragResizeSlotHighlightContainerStyle}">
       <Setter Property="MinHeight" Value="{Binding OriginalEvent.Height}"/>


  2. Polya
    Polya avatar
    191 posts

    Posted 24 Nov 2015 Link to this post

    Hello Martin,

    The OriginalEvent property is not available for the DragResizeSlotHighlightContainer because this container has a different DataContext type from the EventContainer's. The DataContext for the DragResizeSlotHighlightContainer is of type Telerik.Windows.Controls.GanttView.DragResizeSlotHighlightContainer.Proxy.

    The Proxy.Task property is transferred in the control template of the DragResizeSlotHighlightContainer, so I suggest modifying the control template and adding the MinHeight property for the containing Grid. For example, if you are using the Windows8Touch theme the style should look like that:
    <Style TargetType="telerik:DragResizeSlotHighlightContainer" BasedOn="{StaticResource DragResizeSlotHighlightContainerStyle}">
        <Setter Property="Template">
                <ControlTemplate TargetType="telerik:DragResizeSlotHighlightContainer">
                    <Grid MinHeight="{Binding Task.Height}">
                        <Border Background="{TemplateBinding Background}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity="0.7"/>
                        <Border Background="{telerik:Windows8TouchResource ResourceKey=InvertedBrush}" Opacity="0.3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>

    Hope this helps.

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