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
515
auto-sizing of xamdatagrid inside docingmanager contentpane
posted

i'm using an xamdatagrid inside a contentpane of a docking manager.

i assign a datacontext inside the code-behind's Window.Loaded event handler.

The grid is bound to a view model (clr-object).

The MaxWidth is set to positive infinity and the width to (auto).

When the window opens the grid's width is much more than would be necessary to display the columns.

I'd suppose the grid to auto-size depending on displayed column sizes but it seems it doesnt do so.

setting the grid max width or the grid.width is not acceptable because the grid shall fit to any size when the user resizes or (re)docks the content panes.

as a workaround i tried various ways to but i couldnt succeed to find one that's working.

can you help me?