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

DragResizeSlotHighlightContainer

1 Answer 70 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 21 Nov 2015, 01:15 PM

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}"/>
</Style>

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}"/>
</Style>

 

1 Answer, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 24 Nov 2015, 06:45 PM
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">
        <Setter.Value>
            <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"/>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Hope this helps.

Regards,
Polya
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
Martin
Top achievements
Rank 1
Answers by
Polya
Telerik team
Share this question
or