RadGanttView: how to change row height..

2 posts, 0 answers
  1. mares40
    mares40 avatar
    1 posts
    Member since:
    Jan 2019

    Posted 05 Apr 2019 Link to this post

    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

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    1173 posts

    Posted 09 Apr 2019 Link to this post

    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.
Back to Top