11557 : OnGanttRowMinHeightChange

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…