Articles in this section
Category / Section

How to prevent resizing the last column, when parent Grid width is less than the child Grid width in Silvelright ?

1 min read

When you resize the last column of parent grid towards left, the child grid columns go out of view in MasterDetails view of SfDataGrid as the width of the parent grid is lesser than the width of the child grid. Therefore, after resizing you cannot view the remaining child grid columns in view.

The following screenshot illustrates a four child Grid columns that is clipped due to resizing parent Grid in left wards.

C:\Users\ApoorvahR\Desktop\1.jpg

Figure 1: Four child Grid columns clipped due to resizing parent Grid in left wards

To overcome this problem, disable the resizing support for the last column in parent grid and you can achieve this by setting DetailsViewManager.DisableLastColumnResizing attached property as true, as per the following code example.

XAML

<Window x:Class="DetailsViewSimple.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Local="clr-namespace:DetailsViewSimple"
        xmlns:syncfusion="http://schemas.syncfusion.com/wpf">
<syncfusion:SfDataGrid x:Name="dataGrid" 
                   AllowResizingColumns="True"
                   AllowResizingHiddenColumns="True"
                   HideEmptyGridViewDefinition="True"
                   syncfusion:DetailsViewManager.DisableLastColumnResizing="True"
                   ItemsSource="{Binding Path=OrdersDetails}"> 
</syncfusion:SfDataGrid>

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied