Alter Row Height in Theme

5 posts, 0 answers
  1. Chris
    Chris avatar
    18 posts
    Member since:
    Jan 2009

    Posted 10 Jun 2010 Link to this post

    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

  2. Kalin Milanov
    Admin
    Kalin Milanov avatar
    447 posts

    Posted 14 Jun 2010 Link to this post

    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.
  3. DevCraft banner
  4. Pranama Moorthy
    Pranama Moorthy avatar
    26 posts
    Member since:
    Jun 2010

    Posted 01 Jul 2010 Link to this post

    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?
  5. Chris
    Chris avatar
    18 posts
    Member since:
    Jan 2009

    Posted 01 Jul 2010 Link to this post

    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

  6. Kalin Milanov
    Admin
    Kalin Milanov avatar
    447 posts

    Posted 07 Jul 2010 Link to this post

    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
Back to Top
DevCraft banner