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

Vertical spacing of radgrid with fixed headers and no data.

6 Answers 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 06 Sep 2013, 07:39 PM
We have several radgrids with toolbars on top, column headers, and page footers.  One of the options in the paging footer is to set the number of lines displayed in the grid.  Since this number is allowed to be much larger than may be displayable on the current monitor, we would much prefer fixed headers and internal scrolling in the grid.

The problem is when there is no data in the grid.  In this case, the footer is not at the bottom of the window as it is in all other cases, it is immediately below the colum headers with only the height of one horizontal scrollbar between the two.  If the horizontal scroll bar is needed because the column widths add to wider than the screen, our custom no data message is hidden by the scrollbar.  If there is not a need for the scrollbar, then the top half of our custom no data message is displayed with the bottom half of the message obscured by the footer.

I believe that we are on 2102 Q3 SP2
Two questions:
1)  Is there a work around for this?
2)  Is it fixed in a more recent build?

6 Answers, 1 is accepted

Sort by
0
Galin
Telerik team
answered on 11 Sep 2013, 02:35 PM
Hi John,

You can achieve the desired behavior by setting the property Height to 100% on the RadGrid. For more information please refer to this code library.

I hope this helps.

Regards,
Galin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
John
Top achievements
Rank 1
answered on 11 Sep 2013, 02:47 PM
I have been working on this, and it all works correctly except in the cases where the radgrid is placed on a multipage with a tabstrip.  The multipageparent has a height of 0, and always seems to dynamically set its height to the height of the content.  I have not found a way to override this behavior.  The multipage is contained in a resizable window, and should be the full height of the window - the height of the tabstrip.  Unfortunately, with static headers, the RadGrid (the only content) is attempting to set its height to the container (height 0).  There is a conflict of behavior which seems extremely difficult to resolve.
0
Galin
Telerik team
answered on 16 Sep 2013, 11:23 AM
Hi John,

Keep in mind that in case an element (RadGrid, RadMultiPage or a  regular HTML element) has Height="100%"  you should set a fixed height in pixels of its container. Also it is possible this container to have height dimension in percents, but in this case you should care about its wrapper (parent element) as well.

In case the issue persists please provide a sample runnable project, so I can better investigate your scenario.


Regards,
Galin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
John
Top achievements
Rank 1
answered on 16 Sep 2013, 01:03 PM
The problem is that the RadMultiPage has an internal container that I do not control that seems to always have a height of 0, no matter what I do to the rad multi page.  This internal container then sets its height to its contents.  The work around is extremely painful, and since I have not completed it yet may not even be possible.  The grid needs to be dynamically resized to fit the window that contains it (our UI constraint).

Problems encountered along the way:
1)   I have to set the height of the grid in pixels dynamically depending on the height of the containing window as the height changes.
2)  Maximize is not treated as a resize event, and it is difficult to actually get the new height information to resize the grid.  The Maximize message happens **before** the actual maximize takes place.  No message occurs after the maximize takes place.
3)  Once maximized, I now need to figure out how to get messages from the browser about size changes as these are also not treated as resize events by the radwindow. 

In all, this has been a failrly painful experience.
Items that would help dramatically:
1)  Have some flag that is not setting the height of the RadMultiPage to a fixed height in pixels that tells the RadMultiPage to NOT resize to contents.  (This would probably solve the problem completely).
2)  Have some message that occurs after the maximize event occurs.
3)  Have the browser resize events pass through to the radwindow onresize handlers (client and server) if the radwindow is maximized and the browser resizes.

For the moment, we are stuck on Q3 2012 SP2.
0
Galin
Telerik team
answered on 19 Sep 2013, 01:39 PM
Hello John,

As I previously mentioned, without having an option to inspect your application locally it would not be possible to isolate the root cause of the issue. Therefore could you provide a runnable version of your application or the full page markup as well as the related code behind, CSS and JS files so that I could inspect them locally and provide straight to-the-point solution.

Regards,
Galin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
John
Top achievements
Rank 1
answered on 19 Sep 2013, 02:38 PM
I got it to work, however, it was extremely painful workaing around the design decisions made by Telerik. 

The exercise is in concept very simple.

Have a page that has a button that brings up a RadWindow. 
On the RadWindow have a multi-page controlled by a tabstrip.
In each multi page have a radgrid.
Have the RadGrid size to the freespace below the TabStrip in the radwindow, for all of the cases - size the radwindow by grabbing a corner or the top / bottom edge; maximize the radwindow within the browser window (radwindow takes the full browser area when maximized); when maximized, have the grid resize when the browser window is resized by grabbing a corner, top or bottom edge, maximized, or restored; have the radgrid resize when the radwindow is restored.  Since there is a radgrid on each tab, and rendering each one has a cost, only render the one page in the multipage that is displayed.  This means that a tab change goes to codebehind to switch tabs.

Notes:  Since the radgrid is supposed to size to the containing window, there can be no fixed sized anything within the radwindow.  Thus eliminating the "just use a fixed size grid or a fixed size for the multi-page", and "just use a fixed size for the multi page" from consideration.

The solution, which took days to put together:
1)  Hook the RadWindow Client resize.  Figure out what the magic number is for the space available below the tabstrip.
2)  Hook the Radwindow command "Maximize" and "Restore" commands.  Set a timeout for the function that needs to be called.
3)  On Maximize, hook the browser resize messages.
4)  Hook pageLoad in the client to get a resize on change of tab.

This was really painful, and if there had been a flag to indicate to the rad multi page to sze to the container rather than to the contents, it would have taken much less time, and be much more reliable.
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Galin
Telerik team
John
Top achievements
Rank 1
Share this question
or