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
30
Fixed first header column
posted

Hello.

When I scroll on my grid the first column is the only one fixed on top. I want all my columns fixed or none of them.

Here my code. Thanks

<ig:XamDataGrid  x:Name="grdPickTickets" FontSize="10.667" SelectionMode="SingleRow" Grid.Row="1" Margin="5,5,5,5" Background="{ThemeResource AppBarItemBackgroundThemeBrush}" CellClicked="grdPickTickets_CellClicked" >
                <ig:XamDataGrid.Columns >
                    <ig:TemplateColumn Key="Id" Title="Id" HorizontalAlignment="Center" Background="LightGray" CellUpdating="TemplateColumn_CellUpdating">
                        <ig:TemplateColumn.Header>
                            <ig:TextHeader Background="Black" TextColor="White" HorizontalAlignment="Center" ></ig:TextHeader>
                        </ig:TemplateColumn.Header>
                    </ig:TemplateColumn>
                    <ig:TemplateColumn Key="Status" Title="Status" HorizontalAlignment="Center" Background="LightGray" CellUpdating="TemplateColumn_CellUpdating">
                        <ig:TemplateColumn.Header>
                            <ig:TextHeader Background="Black" TextColor="White"  HorizontalAlignment="Center"></ig:TextHeader>
                        </ig:TemplateColumn.Header>
                    </ig:TemplateColumn>
                    <!--<ig:TemplateColumn Key="Jobs" Title="Job" HorizontalAlignment="Center" Background="LightGray">
                    <ig:TemplateColumn.Header>
                        <ig:TextHeader Background="Black" TextColor="White"  HorizontalAlignment="Center"></ig:TextHeader>
                    </ig:TemplateColumn.Header>
                </ig:TemplateColumn>-->
                    <ig:TemplateColumn Key="AssignedUserName" Title="User" HorizontalAlignment="Center" Background="LightGray" CellUpdating="TemplateColumn_CellUpdating">
                        <ig:TemplateColumn.Header>
                            <ig:TextHeader Background="Black" TextColor="White"  HorizontalAlignment="Center"></ig:TextHeader>
                        </ig:TemplateColumn.Header>
                    </ig:TemplateColumn>
                    <ig:TemplateColumn Key="SODPartNumber" Title="SOD Part #" HorizontalAlignment="Left" Background="LightGray" CellUpdating="TemplateColumn_CellUpdating">
                        <ig:TemplateColumn.Header>
                            <ig:TextHeader Background="Black" TextColor="White"  HorizontalAlignment="Center"></ig:TextHeader>
                        </ig:TemplateColumn.Header>
                        <ig:TemplateColumn.Width>
                            <ig:ColumnWidth Value="150"></ig:ColumnWidth>
                        </ig:TemplateColumn.Width>
                    </ig:TemplateColumn>
                </ig:XamDataGrid.Columns>
            </ig:XamDataGrid>
Parents
  • 25665
    Offline posted

    Hello Jose,

    Thank you for contacting Infragistics!

    I followed the steps you suggested and was unable to reproduce the behavior you're describing. I created a sample with multiple columns and scrolling and the column headers remained fixed to the top of the grid.

    I have attached the sample project I used to test this.  Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.

    If the project does not work correctly, then the change in behavior is due to differences in your environment from mine and these differences can be anything from operating system version to the specific version of the Infragistics DLL versions used.  My test was performed using version 17.2.20172.2077 in Infragistics for WPF 2017 Volume 2.  Please provide more details about your machine and version of the assemblies that you are referencing so that I can modify the environment that I am testing in to match yours.

    If the project does show the product feature working correctly, then more information will be needed to reproduce the issue in a sample that can be used for debugging.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.  This can be done by either be done by making the sample that I provided more like your application or by isolating the behavior from your application by removing dependencies on any third parties or databases.

    Please let me know if I can provide any further assistance.

    XamDataGrid.zip

Reply
  • 30
    Offline posted in reply to Michael Peterson

    I'm using 

    InfragisticsUWP.Controls.Grids.XamDataGrid v2016.2.247

    Microsoft.NETCore.UniversalWindowsPlatform v5.0.0

    Here my App.xaml

    <Application
        x:Class="HandHeld.UI.App"
        xmlns="
    http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:HandHeld.UI"
        xmlns:ig="using:Infragistics.Controls"
        RequestedTheme="Dark">
        <Application.Resources>
            <!--Current background Image-->
            <ImageBrush x:Key="BackgroundImage"  Stretch="UniformToFill"  ImageSource="ms-appx:///Images/b2.jpg"/>
            <Style x:Key="TextBoxStyle" TargetType="TextBox">
                <Setter Property="Margin" Value="10,10,10,10"></Setter>
                <Setter Property="FontSize" Value="10.667"/>
                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
             </Style>
            <Style x:Key="SPanelBackground" TargetType="StackPanel" >
                <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeBlackMediumBrush}"/>
                <Setter Property="Opacity" Value="0.7"/>
            </Style>
            <Style x:Key="SGridBackground" TargetType="Grid" >
                <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeBlackMediumBrush}"/>
                <Setter Property="Opacity" Value="0.7"/>
            </Style>
            <Style x:Key="ButtonBackground" TargetType="Button" >
                <Setter Property="BorderBrush" Value="Black" />
                <Setter Property="BorderThickness" Value="0.5" />
                <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeBlackMediumBrush}"></Setter>
                <Setter Property="Foreground" Value="White" />           
                <Setter Property="HorizontalAlignment" Value="Stretch" />
                <Setter Property="Margin" Value="15,1,15,1"></Setter>
            </Style>
            <Style x:Key="TextBlockStyle" TargetType="TextBlock" >
                <Setter Property="Padding"  Value="0,0,10,0"/>
                <Setter Property="Foreground" Value="White"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
                <Setter Property="HorizontalAlignment" Value="Right"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="FontSize" Value="10.667"/>
            </Style>
          
            <Style x:Key="RadioButtonStyle" TargetType="RadioButton" >
                <!--<Setter Property="Padding"  Value="0,0,10,0"/>-->
                <Setter Property="Foreground" Value="White"/>
                <Setter Property="HorizontalAlignment" Value="Right"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="FontSize" Value="10.667"/>
            </Style>
            <Style x:Key="ComboBoxStyle" TargetType="ComboBox" >
                <Setter Property="Margin"  Value="10,10,10,10"/>
                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                <Setter Property="FontSize" Value="10.667"/>
                <Setter Property="Foreground" Value="White"/>
            </Style>
            <Style x:Key="FormButtonStyle" TargetType="Button">
                <Setter Property="Margin" Value="10,10,10,10"></Setter>
                <Setter Property="FontSize" Value="10.667"/>
                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                <Setter Property="Background">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF02302" Offset="0.06"/>
                            <GradientStop Color="#FFE8790B" Offset="1"/>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderBrush" Value="Black" />
                <Setter Property="BorderThickness" Value="0.5" />
                <Setter Property="Foreground" Value="White" />
            </Style>
            <Style x:Key="FormSelectButtonStyle" TargetType="Button">
                <Setter Property="FontSize" Value="10.667"/>
                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeBlackMediumBrush}"/>
                <Setter Property="BorderBrush" Value="Black" />
                <Setter Property="BorderThickness" Value="0.5" />
                <Setter Property="Foreground" Value="White" />
                <Setter Property="Opacity" Value="0.7" />
            </Style>
            <Style x:Key="SGridStyle" TargetType="Grid" >
                <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeBlackMediumBrush}"/>
                <Setter Property="Opacity" Value="0.7"/>
                <Setter Property="Margin" Value="5,5,5,5"/>
                <Setter Property="Padding" Value="10,2,8,2"/>
            </Style>
            <Style x:Key="SPanel" TargetType="StackPanel" >
                <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeBlackMediumBrush}"/>
                <Setter Property="Opacity" Value="0.7"/>
                <Setter Property="Margin" Value="5,5,5,5"/>
                <Setter Property="Padding" Value="10,2,8,2"/>
            </Style>
            <Style x:Key="SPanelTextBlockStyle" TargetType="TextBlock" >
                <Setter Property="Padding"  Value="0,0,10,0"/>
                <Setter Property="Foreground" Value="White"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
                <Setter Property="HorizontalAlignment" Value="Right"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="FontSize" Value="10.667"/>
                <Setter Property="Width" Value="130"/>
                <Setter Property="TextAlignment" Value="Right"/>
                <!--<Setter Property="fon" Value="Right"/>-->
            </Style>
            <Style x:Key="SPanelTextBoxStyle" TargetType="TextBox">
                <Setter Property="Margin" Value="10,10,10,10"></Setter>
                <Setter Property="FontSize" Value="10.667"/>
                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                <Setter Property="Foreground" Value="White"/>
            </Style>
            <Style x:Key="TextBlockInfoStyle" TargetType="TextBlock" >
                <Setter Property="Margin" Value="10,10,10,10"></Setter>
                <Setter Property="FontSize" Value="10.667"/>
                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
            </Style>
            <Style x:Key="DataGridTextBlock" TargetType="TextBlock" >
                <Setter Property="Foreground" Value="Black"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
            </Style>
        </Application.Resources>
       
    </Application>
Children