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
590
XamDataGrid * Row Height
posted

Hello,

I have a XamDataGrid where I want all content to fit in the grid when the parent control is resized, no horizontal or vertical scrollbars. This might sound strange but I'm displaying data where the user is looking for certain patterns, not so much the actual values. For example, if I have 50 rows and 10 columns I want the 50 rows and 10 columns to fit without having to scroll no matter how small the cells might be.

Using Width='*' on all of my fields takes care of the columns very nicely.

How can I do something similar for row height?

How can I do something similar for font size so that values fit into the resized cells (as best they can)?

My current plan is to implement the SizeChanged event on the XamDataGrid and change the font size based on some ratio I come up with and calculate a row height (though I'm not sure how to set it yet.) But if there's a better solution I'd really like to find it.

Thanks!

  • 1530
    Verified Answer
    posted

    Hi,

    You can set CellHeight, CellMaxHeight, CellMinHeight properties of the FieldSettings to manipulate the row's height. Another way would be to create a style for the DataRecordPresenter and set the Height and FontSize there. I have attached a sample where I am dynamically changing the style in the SizeChanged event with proper ratio as you suggested.

    I hope this helps. If you have any questions please do not hesitate to ask.

    Thanks,
    Teodor
    Software Developer
    www.infragistics.com/support

    FieldAutoWidth.zip