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

GridView row heights and padding

3 Answers 909 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hennie
Top achievements
Rank 1
Hennie asked on 15 Nov 2010, 10:59 PM
Hi

How do I decrease the padding or margin of a grid's rows/cells so the overall height of the row is decreased.

Hennie

3 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 16 Nov 2010, 04:36 PM
Hi Hennie,


If you want to be able to decrease Padding/Margin properties in GridViewCells you can create a simple style that is targeted at GridViewCell and set its Padding property to a value that will satisfy your personal requirements. On the other hand RadGridView has a property RowHeight which you can use to manipulate the height of GridViewRows. At the attached sample are demonstrated both approaches.



If you need any further assistance please let me know.


Kind regards,
Vanya Pavlova
the Telerik team
See What's New in RadControls for WPF in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
0
Kumar
Top achievements
Rank 1
answered on 13 Oct 2011, 09:03 PM
Hello Telerik Team,

I cannot set the RowHeight to a fix value as my app allows the user to increase/ decrease the font size. If the RowHeight is set to a fix value and the font size is made too large the row content overflows.

Setting the Padding as described did not help in reducing the height of the row.

What do you guys suggest? I think there is a lot of padding on the top and bottom of the row / cell there has to be a way to control just this without templating the entire row or cell

Let me know.

Regards,
Kumar
0
Vanya Pavlova
Telerik team
answered on 14 Oct 2011, 07:49 PM
Hi Kumar,

 

Resetting the Padding of a cell will remove the default space around GridViewCell's Content.
Combining this with a fixed row height should do the trick.
Indeed the approach described in my previous post is the recommended one.



Kind regards,
Vanya Pavlova
the Telerik team

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

Tags
GridView
Asked by
Hennie
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Kumar
Top achievements
Rank 1
Share this question
or