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

RadGanttView: how to change row height..

1 Answer 41 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
mares40
Top achievements
Rank 1
mares40 asked on 05 Apr 2019, 09:59 AM

Hi guys, 

I'm trying to decrease the GanttView row height, I'm using the Material Theme and I'm able to do it.

 

I already set this style on my xaml without luck

 

<sys:Double x:Key="RowHeight">8</sys:Double>

                                    <Style TargetType="telerik:SimpleCellContainer" BasedOn="{StaticResource SimpleCellContainerStyle}">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>
                                    <Style TargetType="telerik:CellContainer" BasedOn="{StaticResource CellContainerStyle}">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>
                                    <Style TargetType="telerik:CellEditingContainer" BasedOn="{StaticResource CellEditingContainerStyle }">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>
                                    <Style TargetType="telerik:SimpleTreeCellContainer" BasedOn="{StaticResource SimpleTreeCellContainerStyle }">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>
                                    <Style TargetType="telerik:DragResizeSlotHighlightContainer" BasedOn="{StaticResource DragResizeSlotHighlightContainerStyle}">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>
                                    <Style TargetType="telerik:CellHighlightContainer" BasedOn="{StaticResource CellHighlightContainerStyle}">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>

 

Someone can help me?

 

Best regards

Enrico

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 09 Apr 2019, 12:54 PM
Hi Enrico,

To set the row height to a value lower than the default MinHeight, you also need to set the MaxHeight property.

<sys:Double x:Key="RowHeight">25</sys:Double>
 
<Style TargetType="telerik:SimpleCellContainer" BasedOn="{StaticResource SimpleCellContainerStyle}">
    <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" />
    <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
</Style>
<Style TargetType="telerik:CellContainer" BasedOn="{StaticResource CellContainerStyle}">
    <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" />
    <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
</Style>
<Style TargetType="telerik:CellEditingContainer" BasedOn="{StaticResource CellEditingContainerStyle}">
    <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" />
    <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
</Style>
<Style TargetType="telerik:SimpleTreeCellContainer" BasedOn="{StaticResource SimpleTreeCellContainerStyle}">
    <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" />
    <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
</Style>
<Style TargetType="telerik:DragResizeSlotHighlightContainer" BasedOn="{StaticResource DragResizeSlotHighlightContainerStyle}">
    <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" />
    <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
</Style>
<Style TargetType="telerik:CellHighlightContainer" BasedOn="{StaticResource CellHighlightContainerStyle}">
    <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" />
    <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
</Style>
<Style TargetType="telerik:TreeCellHighlightContainer" BasedOn="{StaticResource TreeCellHighlightContainerStyle}">
    <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" />
    <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
</Style>
<Style TargetType="telerik:TreeCellEditingContainer" BasedOn="{StaticResource TreeCellEditingContainerStyle}">
    <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" />
    <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
    <Style.Resources>
        <Style TargetType="TextBox" BasedOn="{StaticResource TextBoxStyle}">
            <Setter Property="Padding" Value="0" />
        </Style>
    </Style.Resources>
</Style>

Please note, however, that if you wish to use such a small value, you may also want to edit the appearance of other comprising elements such as EventContainer, SummaryContainer, RelationContainer. You can see that I've also modified the style for the TextBox of the cells in edit-mode.

For your convenience, I'm also attaching a small sample project demonstrating this approach.

Please have a look and let me know if this would work for you. Do also feel free to vote for this feature request we have logged in our feedback portal regarding this.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GanttView
Asked by
mares40
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or