Possible to fit docked window to contents?

Hi,

I'm just starting to work with the Docking Manager. I have a left docked window and inside it I put a ListView which contains a GridView with some binded data. The inner controls work fine but they are wider than the width of the docked window, which results in a scroll bar to view the ListView. I would like the docked window to stretch to fit the width of its contents. How could I achieve this?


Thanks.



1 Reply 1 reply marked as answer

DR Durga Rajan Syncfusion Team February 24, 2022 08:26 AM UTC

Hi Lorenzo,


We suggest you to use DesiredWidthIndockMode property of DockingManager to set desired width for the docked window. Please find the code snippet for the same,


<syncfusion:DockingManager>

            <ContentControl syncfusion:DockingManager.Header="Dock Panel" syncfusion:DockingManager.DesiredWidthInDockedMode="{Binding ElementName=listViewItem, Path=ActualWidth}">

                <ListView>

                    <ListViewItem x:Name="listViewItem" Content="The desired width can be set for the Dock windows through DesiredWidthInDockedMode with the desired values."/>

                </ListView>

            </ContentControl>

        </syncfusion:DockingManager>


UG link : https://help.syncfusion.com/wpf/docking/dealing-with-windows#configuring-window-sizing


Please let us know if we have misunderstood your query.


Regards,

Durga


Marked as answer
Loader.
Up arrow icon