Changing Size of Gantt Column

1 Answer 160 Views
GanttView
Marco
Top achievements
Rank 1
Iron
Iron
Iron
Marco asked on 07 Dec 2021, 11:59 AM

I want to add a small arrow in the column header. This worked perfect. And if I click on this arrow, the column should have a ver small size (almost invisible).

So I have to set the column width almost to zero. Is there a way to set the width programmatically? I could only set the header width, but not the full column width.

 

This is my wpf to show the arrow:

                    <Style TargetType="telerik:ColumnHeaderContainer" BasedOn="{StaticResource ColumnHeaderContainerStyle}">
                        <Setter Property="ContentTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Grid.Column="0" Text="{Binding Header}" />
                                        <Polygon Grid.Column="1" Points="7.5,5 11.5,2 11.5,8 7.5,5" Stroke="Black" StrokeThickness="1" VerticalAlignment="Bottom" 
                                                 HorizontalAlignment="Right" MouseDown="SpalteZusammenklappen">
                                            <Polygon.Style>
                                                <Style TargetType="Polygon">
                                                    <Style.Triggers>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter Property="Polygon.Fill">
                                                                <Setter.Value>
                                                                    <SolidColorBrush Color="Black"/>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </Trigger>
                                                        <Trigger Property="IsMouseOver" Value="False">
                                                            <Setter Property="Polygon.Fill">
                                                                <Setter.Value>
                                                                    <SolidColorBrush Color="White"/>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </Trigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Polygon.Style>
                                            <Polygon.RenderTransform>
                                                <RotateTransform Angle="-37" />
                                            </Polygon.RenderTransform>
                                        </Polygon>
                                    </Grid>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>

So my Header looks like this:

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 09 Dec 2021, 01:25 PM

Hello Marco,

Currently, the width of the column cannot be changed at runtime due to a bug present in the RadGanttView control, and unfortunately, I was not able to find a workaround that meets the specified requirement. You could find the bug report, which is logged into our feedback portal and you could vote for it, as well as follow it, to get notified via e-mail when its status changes.

With that said, if you need any further help regarding our products, do not hesitate to contact us.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Marco
Top achievements
Rank 1
Iron
Iron
Iron
commented on 09 Dec 2021, 01:52 PM | edited

Hi Stenly

Thank you for your answer. Sadly, that this doesn't work. I already voted for this item so I hope it will be done in future.

Regards, Marco

Tags
GanttView
Asked by
Marco
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Stenly
Telerik team
Share this question
or