We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Datagrid vertical scroll is not possible when datagrid is inside stacklayout

HI,
when i have datagrid inside a stacklayout, vertical scroll is not working, not even appearing. Same code works if I move it outside stacklayout

   <StackPanel Orientation="Vertical" >
            <Label Content="DESCRIPTIONS" FontSize="20" Foreground="Black" />
            <syncfusion:SfDataGrid  x:Name="dataGrid"  ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Auto" EditTrigger="OnTap" AutoGenerateColumns="True" ItemsSource="{Binding RelativeSource={RelativeSource 
                                  FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.Descriptions}"  AllowDeleting="False"
                       AllowResizingColumns="True"
                             AllowEditing="False"     AllowFiltering="True"   AllowDraggingColumns="True" >
            </syncfusion:SfDataGrid>
        </StackPanel>

1 Reply

JG Jai Ganesh S Syncfusion Team November 29, 2016 12:51 PM UTC

Hi Emil, 
 
We have analyzed your query. When we loading the datagrid inside a stacklayout, the vertical scroll is not showing. This is the default behavior of SfDataGrid. However, to overcome this by setting the Height for SfDataGrid like below, 
 
<syncfusion:SfDataGrid x:Name="datagrid"  
                                        ItemsSource="{Binding GDCSource}" 
                                        AllowEditing="True" 
                                        Height="500" 
                                        SelectionMode="Multiple" 
                                        AutoGenerateColumns="True"                                            
                                        AllowGrouping="True"  
                                        ShowGroupDropArea="True"> 
 
 
Regards, 
Jai Ganesh S 


Loader.
Up arrow icon