Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
Setting Max Height
posted

I’ve placed a XamDataGrid with both Height & Width set to Auto and the MaxHeight and MaxWidth set to Infinity inside a UserControl Object, That is itself placed as a Child of a WrapPanel in a ScrollDoc object. I then format and add multiple rows of Data programmatically to the XamDataGrid.

I discovered that after a relatively small number of rows the XamDataGrid automatically creates a ScrollBar, and doesn’t display all the records.  My Clients want one scroll bar for all records with none hidden;

So I then set the Max Height to a large value (in this case 100,000) and while this forced the data grid to display fully, it then however lead to an issue of Out of Memory Exceptions being thrown with all my windows in the program being deleted and redrawn in no particular order;

In this instance there were 56 XamDataGrids and 8557 rows between all of them.

Is there a way to Display all the rows within the XamDataGrids like my Client wants, without causing Out of Memory Exceptions?

Parents
  • 69686
    posted

    Hello,

    I am sorry, I did not understand your scenario completely. I am not sure why you set MaxHeight/MaxWidth as well as Height and Width properties, as they are set to Infinity by default. According to your description, both the XamDataGrid and the ScrollViewer have scrollbars?

    I also do not see a reason why the OutOfMemoryException is thrown. Have you set the RecordContainerGenerationMode to PreLoad?

    If you have a mock application that reproduces the scrollbar issues, please attach it to your next post, or a screenshot.

    Thanks.

Reply Children