this.DataGrid1.Loaded += DataGrid1_Loaded;
private void DataGrid1_Loaded(object sender, RoutedEventArgs e)
{
VisualContainer visualContiner1 = this.DataGrid1.GetVisualContainer();
//checking the DataGrid height and VisualContiner ExtendedWidth (Total number of Row height)
if (this.DataGrid1.ActualHeight > visualContiner1.ExtentHeight)
visualContiner1.ScrollOwner.VerticalScrollMode = ScrollMode.Disabled;
if (this.DataGrid1.ActualWidth > visualContiner1.ExtentWidth)
visualContiner1.ScrollOwner.HorizontalScrollMode = ScrollMode.Disabled;
} |
<syncfusion:SfDataGrid x:Name="DataGrid1"
ScrollViewer.IsVerticalRailEnabled="True"
ScrollViewer.IsVerticalScrollChainingEnabled="True"
Height="400"
Margin="0, 0, 12, 0"
ItemsSource="{x:Bind Fields.TestClassList0, Mode=OneWay}">
</syncfusion:SfDataGrid> |