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
90
Datagrid overflows layout on 64 bit systems
posted

Hello,

we currently face the problem, that the datagrid doesn´t recognize the available space for it on 64 bit systems and overflows the layout without scrollbars.

You find screenshots attached, how it should be (and is on 32bit systems) --> 32bit.jpg (attached to next post) and how it is on 64bit systems --> 64bit.jpg

Following you find the corresponding code for the datagrid.

<UserControl x:Class="JVS.View.DataGrids.DataGridErlegung"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:igDP="http://infragistics.com/DataPresenter"
    xmlns:igEditors="http://infragistics.com/Editors"
    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">

    <DockPanel Name="dp" Width="Auto" Height="Auto">
        <igDP:XamDataGrid DockPanel.Dock="Top" Height="Auto" Margin="0" Name="dgErlegung" Width="Auto" Theme="Onyx" GroupByAreaStyle="{StaticResource ResourceKey=MyCustomGroupByArea}">
            <igDP:XamDataGrid.Resources>
                <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="WrapField">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                <TextBlock Margin="{TemplateBinding Padding}"
                        Width="{TemplateBinding Width}"
                        Height="{TemplateBinding Height}"
                        Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}"
                        TextWrapping="Wrap"
                        Background="Transparent"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Center" />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </igDP:XamDataGrid.Resources>
            <igDP:XamDataGrid.FieldLayoutSettings>
                <igDP:FieldLayoutSettings AutoGenerateFields="False" AllowAddNew="False" AllowDelete="False">
                </igDP:FieldLayoutSettings>
            </igDP:XamDataGrid.FieldLayoutSettings>
            <igDP:XamDataGrid.FieldLayouts>
                <igDP:FieldLayout>
                    <igDP:FieldLayout.Fields>
                        <igDP:Field Name="Wildart" Label="Wildart">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True" />
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Revier" Label="Revier">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Erlegungsdatum" Label="Erlegungsdatum">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Hochsitz" Label="Hochsitz">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True" />
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Erleger" Label="Erlegt von">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Anzahl" Label="Anzahl">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Bejagungsart" Label="Bejagungsart">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Gewicht" Label="Gewicht">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True" />
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Alter" Label="Alter">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Geschlecht" Label="Geschlecht">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Waffe" Label="Waffe">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True" />
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Falle" Label="Falle">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Schussentfernung" Label="Schussentfernung">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Fluchtstrecke" Label="Fluchtstrecke">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True" />
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="TrophLaenge" Label="Trophäenlänge">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Trophgewicht" Label="Trophäengewicht">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="TrophNotiz" Label="Trophäennotiz">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True" />
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Treffersitz" Label="Treffersitz">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Haematome" Label="Hämatome">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="VerlOrgane" Label="Verletzte Organe">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True" />
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Fallwild" Label="Fallwild">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Todesursache" Label="Todesursache">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Eigenverbrauch" Label="Eigenverbrauch">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True" />
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Erloes" Label="Erlös Wildbret">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Bemerkung" Label="Bemerkung">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" AllowResize="True" CellValuePresenterStyle="{StaticResource WrapField}" CellWidth="600"/>
                            </igDP:Field.Settings>
                        </igDP:Field>
                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
            </igDP:XamDataGrid.FieldLayouts>
        </igDP:XamDataGrid>
        <StackPanel DockPanel.Dock="Top" Background="White">
            <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center">
                <Button Name="btnNeu" Style="{StaticResource ButtonNeu}" Width="110">Erlegung anlegen</Button>
                <Button Name="btnExport" Style="{StaticResource ButtonNeu}" Width="90">Export Excel</Button>
                <Button Name="btnDrucken" Style="{StaticResource ButtonNeu}" Width="80">Drucken</Button>
            </StackPanel>
        </StackPanel>
    </DockPanel>
</UserControl>

 

With kind regards

Frank