2

I have an ASPxGridView with SettingsPager set as

Mode = ShowAllRecords, PageSize = 100000, CurrentPageNumberFormat = '', Visible = False

What I want is to have all the records display with a scroll bar and have no page size at all.

When the containing parent DIV tag is resized the Grid should also adjust it's height. Currently, I see a few records, as many as would fit into the size of the parent div. However, when I resize, I still see the same number of records and empty gray portions at the top and bottom. If the grid does not have a pagesize, I should just be able to see the rows below, right?

EDIT:

Here's what I've tried -

grid.setHeight(newHeight);
grid.AdjustControls();

and also the solution mentioned here, which works fine to set the initial height.

Community
  • 1
  • 1
neuDev33
  • 1,573
  • 7
  • 41
  • 54
  • 1
    Pay attention to a character case: Use the SetHeight() method instead. – Mikhail May 17 '12 at 19:05
  • With "GridView.SettingsPager.Mode = DevExpress.Web.ASPxGridView.GridViewPagerMode.ShowAllRecords;" you do not need to set the PageSize since it will not be used. – Soenhay Aug 01 '12 at 13:56

2 Answers2

2

See this sample on DevExpress website to do what you want.

EDIT: To do the same thing when resizing the containing div, rather than just the browser window, change the JavaScript code to:

<script type="text/javascript">
    function adjustSize(newHeight) {
        grid.SetHeight(newHeight);
    }
</script>

Then, in the JavaScript that resizes the height of the container div, call adjustSize(newHeight) to adjust the size of the grid to match.

Or, more simply, just call grid.SetHeight(whateverSize) in the same block of JavaScript you use to resize the div.

Community
  • 1
  • 1
saluce
  • 13,035
  • 3
  • 50
  • 67
  • This only sets the height on init, I want the height to adjust on resize as well – neuDev33 May 17 '12 at 15:38
  • That code handles the window resize event. I will be resizing the parent "DIV" tag that contains this grid, I already have this code to handle the initial height, and this does not help resize the grid on the "DIV" resize – neuDev33 May 17 '12 at 15:41
1

It is necessary to specify/correct the Height on:

  • Control Init;

  • Window Resize.

Use recomendations from the following examples to accomplish this task:

How to use the ASPxPageControl control in a Full Screen mode

Change the VerticalScrollableHeight on the client based on the browser window height

Mikhail
  • 9,186
  • 4
  • 33
  • 49