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

RadGridview Group Panel Height

6 Answers 275 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tyler
Top achievements
Rank 1
Tyler asked on 18 Jun 2012, 07:12 PM
I am Working on customizing a RadGridview and can't seem to find any way to change the height of the grouping panel. I want to make it a little bit smaller. Is there a way to do this built-in to the control? Or maybe even a work around that anyone has found?
 Here is the code that I have now.

<
telerik:RadGridView Name="ExceptionsListBox" 
                                    IsReadOnly="True"
                                    UseLayoutRounding="False"
                                    EnableRowVirtualization="True"
                                    AutoGenerateColumns="False" 
                                    RowIndicatorVisibility="Collapsed"
                                    Background="#FF202020"
                                    RowHeight="20"
                                      
                                    GroupPanelBackground="#FF202020"
                                    GroupPanelForeground="white" 
                                    telerik:StyleManager.Theme="Expression_Dark">
                   <telerik:RadGridView.Resources>
                       <Style TargetType="telerik:GridViewHeaderRow">
                           <Setter Property="MinHeight" Value="15" />
                       </Style>
                   </telerik:RadGridView.Resources>
                   <telerik:RadGridView.Columns >
                       <telerik:GridViewDataColumn DataMemberBinding="{Binding TruckCode}"
                                                   Header="Truck"/>
                       <telerik:GridViewDataColumn DataMemberBinding="{Binding Content}"
                                                   Header="Content" />
                   </telerik:RadGridView.Columns>
               </telerik:RadGridView>

Thanks for any help.

6 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 19 Jun 2012, 06:56 AM
Hi,

 You could change the height of the Group Panel by defining a style targeting the "GridViewGroupPanel" element.
For example:

<Grid.Resources>
            <Style TargetType="telerik:GridViewGroupPanel">
                <Setter Property="Height" Value="60"/>
            </Style>
</Grid.Resources>

This setting will be applied for all the GridViews defined in the Grid.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Tyler
Top achievements
Rank 1
answered on 19 Jun 2012, 04:25 PM
I have tried this and the Group Panel still wont resize. Is there maybe a property that is overriding it that I do not know about.
Here is the code I am using...I set the height of the panel unreasonably small and it still wont change.

<telerik:RadGridView Name="ExceptionsListBox" 
                                     IsReadOnly="True"
                                     UseLayoutRounding="False"
                                     EnableRowVirtualization="True"
                                     AutoGenerateColumns="False" 
                                     RowIndicatorVisibility="Collapsed"
                                     Background="#FF202020"
                                     RowHeight="20"
                                       
                                     GroupPanelBackground="#FF202020"
                                     GroupPanelForeground="white" 
                                     telerik:StyleManager.Theme="Expression_Dark" >
                      
                    <telerik:RadGridView.Columns >
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding TruckCode}"
                                                    Header="Truck"/>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Content}"
                                                    Header="Content" />
                    </telerik:RadGridView.Columns>
                    <telerik:RadGridView.Resources>
                        <Style TargetType="telerik:GridViewHeaderRow">
                            <Setter Property="MinHeight" Value="15" />
                        </Style>
                        <Style TargetType="telerik:GridViewGroupPanel">
                            <Setter Property="Height" Value="10" />
                        </Style>
                    </telerik:RadGridView.Resources>
                </telerik:RadGridView>
0
Dimitrina
Telerik team
answered on 20 Jun 2012, 07:37 AM
Hi,

As the MinHeight for the GridViewGroupPanel is already set to 32, you should use MinHeight instead of Height.
For example:

<Style TargetType="telerik:GridViewGroupPanel">
       <Setter Property="MinHeight" Value="10"/>
</Style>

Please let me know how this works for you.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Tyler
Top achievements
Rank 1
answered on 20 Jun 2012, 06:25 PM
I have tried this as well and it still doesn't seem to format the group panel any differently. I have created a seperate project that has the minheight and height set to 10. I have attached it to this post so see if you can see the problem I am having and re-create it. I can't seem to get it working. I didnt bind any data to it. just looking for formatting.
<Window x:Class="RadControlsWpfApp2.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525">
        <Grid>
        <telerik:RadGridView Name="ExceptionsListBox" 
                                     IsReadOnly="True"
                                     UseLayoutRounding="False"
                                     EnableRowVirtualization="True"
                                     AutoGenerateColumns="False" 
                                     RowIndicatorVisibility="Collapsed"
                                     Background="#FF202020"
                                     RowHeight="20"
                                     GroupPanelBackground="#FF202020"
                                     GroupPanelForeground="white" 
                                     telerik:StyleManager.Theme="Expression_Dark" >
  
            <telerik:RadGridView.Columns >
                <telerik:GridViewDataColumn DataMemberBinding="{Binding TruckCode}"
                                                    Header="Truck"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Content}"
                                                    Header="Content" />
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.Resources>
                <Style TargetType="telerik:GridViewHeaderRow">
                    <Setter Property="MinHeight" Value="15" />
                </Style>
                <Style TargetType="telerik:GridViewGroupPanel">
                    <Setter Property="MinHeight" Value="10" />
                    <Setter Property="Height" Value="10" />
                </Style>
  
            </telerik:RadGridView.Resources>
        </telerik:RadGridView>
    </Grid>
</Window>
0
Dimitrina
Telerik team
answered on 21 Jun 2012, 10:47 AM
Hello,

 I do not see the attached project that is why I created a test project based on your code snippet. In it the height is set to "10" as expected. Would you please check it and let me know what I should change in order to observe the issue at your end? 

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Matt
Top achievements
Rank 2
answered on 20 Oct 2012, 10:31 PM
Thanks for all your help on this. I work with Tyler, and he was just not using both Height and MinHeight setters like in your example. Once they were applied, it worked fine for our product.
Thanks again!
Tags
GridView
Asked by
Tyler
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Tyler
Top achievements
Rank 1
Matt
Top achievements
Rank 2
Share this question
or