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
1065
How to turn on scrollbar
posted

Hello,

I put a datagrid in a window. The size of the window is smaller than the size of the datagrid, but there is no scrollbar turned on automatically.

How could I turn on the scrollbar?

Thanks.

Parents Reply
  • 1065
    posted in reply to [Infragistics] Dinesh Hosamani

    Please see my sample code below:

    <Window x:Class="DataGrid.Window1"
        xmlns="
    http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:igDP="http://infragistics.com/DataPresenter"
        xmlns:igEditors="http://infragistics.com/Editors"
        xmlns:local="clr-namespace:DataGrid.UserControls"
        Title="DataGrid" Height="300" Width="800">
     
            <Grid>
             
         <Canvas>

                <local:CategoryControl Panel.ZIndex="1" Canvas.Left="5" Canvas.Top="5" x:Name="categoryControl" HorizontalContentAlignment="Left" BorderThickness="1" HorizontalAlignment="Left" />
              
                <igDP:XamDataGrid Canvas.Left="5" Canvas.Top="33" Panel.ZIndex="0" x:Name="XamDataGrid1" GroupByAreaLocation="None">          
                    <igDP:XamDataGrid.FieldLayoutSettings>
                        <igDP:FieldLayoutSettings AutoGenerateFields="False" SelectionTypeRecord="Extended" />
                    </igDP:XamDataGrid.FieldLayoutSettings>
                    <igDP:XamDataGrid.FieldSettings>
                        <igDP:FieldSettings AllowEdit="True" CellClickAction="SelectCell" LabelClickAction="SelectField" />
                    </igDP:XamDataGrid.FieldSettings>
                    <igDP:XamDataGrid.FieldLayouts>
                        <igDP:FieldLayout>
                            <igDP:FieldLayout.Settings>
                                <igDP:FieldLayoutSettings LabelLocation="SeparateHeader" />
                            </igDP:FieldLayout.Settings>
                            <igDP:FieldLayout.Fields>
                                <igDP:Field Name="EmployeeNumber">                           
                                    <igDP:Field.Settings>
                                        <igDP:FieldSettings CellWidth="150"/>
                                    </igDP:Field.Settings>
                                </igDP:Field>
                                <igDP:Field Name="FirstName">
                                    <igDP:Field.Settings>
                                        <igDP:FieldSettings CellWidth="130"/>
                                    </igDP:Field.Settings>
                                </igDP:Field>
                                <igDP:Field Name="LastName">
                                    <igDP:Field.Settings>
                                        <igDP:FieldSettings CellWidth="130"/>
                                    </igDP:Field.Settings>
                                </igDP:Field>
                                <igDP:Field Name="Age">
                                    <igDP:Field.Settings>
                                        <igDP:FieldSettings CellWidth="100"/>
                                    </igDP:Field.Settings>
                                </igDP:Field>
                                <igDP:Field Name="Gender">
                                    <igDP:Field.Settings>
                                        <igDP:FieldSettings CellWidth="100"/>
                                    </igDP:Field.Settings>
                                </igDP:Field>
                                <igDP:Field Name="Salary">
                                    <igDP:Field.Settings>
                                        <igDP:FieldSettings CellWidth="100"/>
                                    </igDP:Field.Settings>
                                </igDP:Field>
                                <igDP:Field Name="Pension">
                                    <igDP:Field.Settings>
                                        <igDP:FieldSettings CellWidth="100"/>
                                    </igDP:Field.Settings>
                                </igDP:Field>
                            </igDP:FieldLayout.Fields>
                        </igDP:FieldLayout>
                    </igDP:XamDataGrid.FieldLayouts>
                </igDP:XamDataGrid>    
            </Canvas>
        </Grid>
      
    </Window>

     

Children