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

Alter Row Height in Theme

4 Answers 49 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 10 Jun 2010, 06:04 PM
I'm trying change the Row height for a gridview but I'm having a hard time doing it. We are using a modified version of the Vista theme for version 2010.1.422.1040 of the controls. I had done this in a previous version of the controls by modifying several different MinHeight, Margin, and Padding properties, but this no longer seems to work or I can't find all the areas that need to be modified. I've gone through the Styling documentation and tried following those directions as well but am unable to get a smaller row height. I would be willing to post my modified theme if needed.

Thanks,
Chris

4 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 14 Jun 2010, 09:56 AM
Hello Chris,

I believe that setting the RowHeight property of the RadGridView to the value of your choice should do the trick. Please let me know how this goes.

Best wishes,
Kalin Milanov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Pranama Moorthy
Top achievements
Rank 1
answered on 01 Jul 2010, 01:18 PM
I want the RadGridView to have only the Group Panel shown, hence I am trying to set the rowheight=0 but that doesnt work, if I put anything like rowheight=100 it actually shows it that way, but setting to 0 doesnt work, it always shows the default value.. Can it be amended?
0
Chris
Top achievements
Rank 1
answered on 01 Jul 2010, 08:24 PM
I think the problem is probably in the Theme you are using. When I was trying to make the default Row Height smaller I had to go in and modify the Theme and set a bunch of MinHeight, Margin, and Padding properties to different values. There are several files you would need to modify though to get this to work and with the latest version I was not successful in doing this and nobody from Telerik has been able to help me yet.

What you might want to do is try to do something with Visibility. Try adding these styles to your App.xaml:

        <Style x:Key="InvisibleGridRow" TargetType="grid:GridViewRow"
            <Setter Property="Visibility" Value="Collapsed"/> 
        </Style> 
         
        <Style x:Key="InvisibleGroupRow" TargetType="grid:GridViewGroupRow"
            <Setter Property="Visibility" Value="Collapsed"/> 
        </Style> 
 
        <Style x:Key="InvisibleRowsGrid" TargetType="telerikGridView:RadGridView"
            <Setter Property="RowStyle" Value="{StaticResource InvisibleGridRow}"/> 
            <Setter Property="GroupRowStyle" Value="{StaticResource InvisibleGroupRow}"/> 
        </Style> 

Then set the Style of your grid to {StaticResource InvisibleRowsGrid}. I think that will give you what you're looking for. I assume you wanted the header visible, if not then you could create a similar style for the header and add that to your grid style.

Regards,
Chris

0
Kalin Milanov
Telerik team
answered on 07 Jul 2010, 06:57 AM
Hello Chris,
Hello Pranama

Actually setting the RowHeight property did work for me, although the minimum height of the row does not go below 8. If you look at the sample attached and remove the style which hides the rows you will see this in action.

As for your suggestion to collapse the rows - it was a really neat one and it actually did the trick. I have also added this to the sample. 

I hope both of you will find what you are looking for.

Best wishes,
Kalin Milanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Chris
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Pranama Moorthy
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Share this question
or