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

Grid height on page load

9 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 13 Jul 2009, 03:11 PM
Hi,

Is there a known reason why a RadGrid draws at about 400px height and then once populated it goes to it's proper height (either using a figure set in the ASPX or in the codebehind).  The initial drawing of the control happens and then after about 1 second (sometimes more for a big grid) the final height is set. 

Is this a known issue or shall I try and make a basic example of this for you?

Regards,

Jon

9 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 13 Jul 2009, 03:30 PM
Hello Jon,

When used with static headers enabled, RadGrid may need to adjust its layout on the client, depending on its configuration. If you are setting a Height for the control, then it needs to calculate the height of its data area on the client, because:

1) the total height of the RadGrid must remain as specified
2) the data area is scrollable and needs a pixel height as well
3) the height of the scrollable data area depends on the height of the RadGrid control, the command item row, header, footer, pager, etc. All these may or may not be present, and their height is not known on the server.

In order to avoid the client resizing, please set ScrollHeight in RadGrid > ClientSettings > Scrolling and use the ScrollHeight instead of Height.

Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 13 Jul 2009, 03:56 PM
Hi Dimo,

Great - thanks for that.  It works a treat.  The explanation makes perfect sense.  I think that what confused me is that even though I'd set the height to say 500 px it still initially opened at about 300px high before resizing itself.

Many thanks,

Jon
0
Jon
Top achievements
Rank 1
answered on 13 Jul 2009, 06:31 PM
Hi again Dimo,

I've done a little testing and at the moment I seem to be getting some odd results.  I've set the scrolling heigh and removed the references to the normal Height method.  All works well and the grid appears straight away. 

The problem that I am now getting is that between the pager (set to always be visible) and the bottom of the scrolling region there is now a 17px gap.  Increasing the scrolling height makes the pager move down but the gap stays the same.

Any suggestions on this or shall I send a sample via the support ticket?

Regards,

Jon
0
Dimo
Telerik team
answered on 14 Jul 2009, 07:46 AM
Hello Jon,

The observed problem should not occur if you have removed all settings of the Height property and use only ScrollHeight.

Have you set ShowFooter="true" ? The empty space may be the footer row.

Greetings,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 14 Jul 2009, 08:50 AM
Hi Dimo,

OK I've stepped through the ASPX code removing one thing at a time and after about 20 mins have finally found a trigger for this. If I remove the FrozenColumnsCount shown in the scrolling tab below then the page works properly.  I checked and ShowFooter was false.

Is this a bug that I've found or is it that the FrozenColumnsCount is in the wrong place?

Regards,

Jon

                <ClientSettings> 
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" FrozenColumnsCount="2" ScrollHeight="390"></Scrolling> 
                </ClientSettings> 
0
Dimo
Telerik team
answered on 14 Jul 2009, 09:51 AM
Hello Jon,

You seem to be using frozen columns, while there is no need for horizontal scrolling at all. Please enable this feature only in cases in which the sum of all column widths exceeds the RadGrid width.

All the best,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 14 Jul 2009, 10:09 AM

Hi Dimo,

Surely this is a bug with the control?  Or a missing feature.

Assume that someone resizes a column so much that the columns to the right get forced off the page.  The user would then scroll to the right.  As such a frozen column would sometimes be required even in the instance where initially all columns fit on the screen.

Could you add this in as a bug to get resolved please?

Regards,

Jon

0
Dimo
Telerik team
answered on 14 Jul 2009, 10:36 AM
Hi Jon,

Making the horizontal scrollbar show and hide automatically when using frozen columns, will influence negatively the performance of the control in this case and we believe its a rare scenario and requirement. However, we will consider improving this behavior in the future.

Greetings,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 14 Jul 2009, 11:10 AM
Hi Dimo,

That's a fair point.  Perhaps it's worth having as a flag initially false that can be set to true for the instances where it maybe important. 

I suppose that when this kind of situation arises it's probably worth looking at using the template approach to rows rather than columns.

Thanks for your help with this.

Best Regards,

Jon
Tags
Grid
Asked by
Jon
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Jon
Top achievements
Rank 1
Share this question
or