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

Calculating height of grid depending on number of rows returned

3 Answers 56 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Drammy
Top achievements
Rank 1
Drammy asked on 13 Dec 2009, 10:03 PM
Hi all,

Has anyone solved this problem before (or is there a property that I can set)?

I only want the height of my radGridView to be the height of as many row that are returned.  I don't want the greyspace below the rows.

Any ideas?


Thanks

3 Answers, 1 is accepted

Sort by
0
Drammy
Top achievements
Rank 1
answered on 14 Dec 2009, 05:38 PM
Anyone?
0
Pavel Pavlov
Telerik team
answered on 15 Dec 2009, 09:47 AM
Hi KevReid,

Unfortunately we don't have this  as a feature in RadGridView.
I have already scheduled thisone  to be added - I believe the most intuitive way would be setting RadGridView.Height to Auto to do the trick. We are going to add this  in some of our next releases.

Meanwhile the single workaround I can suggest is to calculate the height and set it explicitly in code behind.

The formula should be something simple  like : RadGridView.Height =  RowsCount * 24 + HeaderHieght + GroupPanelHeight.

And it may be set within the handler of the DataLoaded  event of RadGridView.

Kind regards,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Michael
Top achievements
Rank 1
answered on 06 Apr 2012, 07:24 PM
is this still a problem?
Tags
GridView
Asked by
Drammy
Top achievements
Rank 1
Answers by
Drammy
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Michael
Top achievements
Rank 1
Share this question
or