PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


GTP.NET.Silverlight and WPF FAQ 11557


OnGanttRowMinHeightChange Please note that this article refers to GTP.NET.SL and WPF
Jump to article- 2010-02-06 11:48:00 - Email plexityHide

If you want your GanttRow to increase in height to make room for collided time items; read on.

 

Your row looks something like this:

<HierarchicalDataTemplate  x:Key="RowInfoTemplate"  ItemsSource="{Binding SubNodes}" ItemTemplate="{StaticResource SubRowInfoTemplate}">
        <Grid  MinHeight="25">
            <Grid.ColumnDefinitions>
                <ColumnDefinition ></ColumnDefinition>
                <ColumnDefinition ></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <ph:TreeViewMultiColumnRow MultiColumnCoordinator="{Binding Source={StaticResource MCC}}" LevelReduce="16">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Text="{Binding Text}" Grid.Column="0"></TextBlock>
                <TextBlock Text="{Binding Text}" Grid.Column="1"></TextBlock>
            </ph:TreeViewMultiColumnRow>
                <Canvas >
                    <ph:GanttRow 
                        FollowDateScalerPosition="True"
                        Canvas.Top="-3" BorderThickness="0" Background="Transparent"
                        IncreaseRow_StartHeight ="30" IncreaseRowHeightOnCollision="True" CollisionTimeItemOffset="20"
                        ItemsSource="{Binding Items}" ItemTemplate="{StaticResource SpanTimeItem}" 
                        OnUserDrawTimeItem="GanttRow_OnUserDrawTimeItem" 
                        OnGanttRowMinHeightChange="GanttRow_OnGanttRowMinHeightChange"></ph:GanttRow>
                </Canvas>
        </Grid>
    </HierarchicalDataTemplate>

Notice the the GanttRow is enclosed in a Canvas to allow it to follow the datescaler.
The GanttRow will increase in MinHeight since the IncreaseRowHeightOnCollision="True", but the canvas will not care, since a canvas does not care how big its content is.

So I implemented the OnGanttRowMinHeightChange event:

        private void GanttRow_OnGanttRowMinHeightChange(object sender, OnGanttRowMinHeightChangeArgs e)
        {
            (e.GanttRow.Parent as Canvas).MinHeight=e.NewHeight;
        }
Now the Canvas increased MinHeight will force to enclosing Grid to Increase height...

 

 

Google
WWW plexityHide GTP.NET.SL FAQ
Support

Support intro

Knowledgebase

FAQ phGantTimePackage

FAQ GTP.NET

FAQ GTP.NET.SL and WPF

FAQ general

Testimonials

"This is too GREAT. I must say you have strong support and really good programmers at your place. Your entire team is good. Just Fantastic! – 100%"
Gaurav Patole,
WebTechDevelopers
More testimonials...