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
285
DisplayTemplate Values Disappear on scrolling
posted

I am using a hierarchical XamDataGrid with a Template Field in the second level of the hierarchy.  The Template Field is using the DisplayTemplate property and is set to a DynamicResource in our program.  It was a static resource but it tends to display more often as a DynamicResource. What is happening is when the values are set to “All-All-All” through our DataTemplate the values will disappear to “ - - “ when you are scrolling.   As you scroll around sometimes they come back.  Sometimes they are there when you open the hierarchy, sometimes they are not.  There is zero consistency to this.  I did try to use RecordContainerGenerationMode="Preload".  This made it so the values were never there.  Also the tooltip on the template is always working. 

This is a sample of our Template

<DataTemplate x:Key="FieldDisplayTemplate">

        <TextBlock ToolTip="{StaticResource ToolTip}">

            <Run>

                <Run.Style>

                    <Style TargetType="Run">

                        <Setter Property="Text"

                                Value="{Binding AppliedCode.Code, Mode=OneWay}" />

                        <Setter Property="FontStyle"

                                Value="Italic" />

                        <Style.Triggers>

                            <!-- Code Admin areas - null = All -->

                            <MultiDataTrigger>

                                <MultiDataTrigger.Conditions>

                                    <Condition Binding="{Binding CodeOverrideType, FallbackValue={x:Null}}"

                                               Value="{x:Null}" />

                                    <Condition Binding="{Binding Code, FallbackValue={x:Null}}"

                                               Value="{x:Null}" />

                                    <Condition Binding="{Binding AppliedCode, FallbackValue={x:Null}}"

                                               Value="{x:Null}" />

                                </MultiDataTrigger.Conditions>

                                <Setter Property="Text"

                                        Value="{x:Static LocalResources:Label.All}" />

                                <Setter Property="FontStyle"

                                        Value="Italic" />

                            </MultiDataTrigger>

                            <DataTrigger Binding="{Binding CodeOverrideType, FallbackValue={x:Null}}"

                                         Value="{x:Null}">

                                 <Setter Property="FontStyle"

                                         Value="Normal" />

                            </DataTrigger>

                        </Style.Triggers>

                    </Style>

                </Run.Style>

            </Run>

            -

            <Run>

                <Run.Style>

                    <Style TargetType="Run">

                        <Setter Property="Text"

                                Value="{Binding AppliedCode2.Code, Mode=OneWay}" />

                        <Setter Property="FontStyle"

                                Value="Italic" />

                        <Style.Triggers>

                             <!-- Code Admin areas - null = All -->

                            <MultiDataTrigger>

                                <MultiDataTrigger.Conditions>

                                    <Condition Binding="{Binding CodeOverrideType2, FallbackValue={x:Null}}"

                                               Value="{x:Null}" />

                                    <Condition Binding="{Binding Code2, FallbackValue={x:Null}}"

                                               Value="{x:Null}" />

                                    <Condition Binding="{Binding AppliedCode2, FallbackValue={x:Null}}"

                                               Value="{x:Null}" />

                                </MultiDataTrigger.Conditions>

                                <Setter Property="Text"

                                        Value="{x:Static LocalResources:Label.All}" />

                                <Setter Property="FontStyle"

                                        Value="Italic" />

                            </MultiDataTrigger>

                            <DataTrigger Binding="{Binding CodeOverrideType2, FallbackValue={x:Null}}"

                                         Value="{x:Null}">

                                <Setter Property="FontStyle"

                                        Value="Normal" />

                            </DataTrigger>

                        </Style.Triggers>

                    </Style>

                </Run.Style>

            </Run>

            -

            <Run>

                <Run.Style>

                    <Style TargetType="Run">

                        <Setter Property="Text"

                                Value="{Binding AppliedCode3.Code, Mode=OneWay}" />

                        <Setter Property="FontStyle"

                                Value="Italic" />

                        <Style.Triggers>

                            <!-- Code Admin areas - null = All -->

                            <MultiDataTrigger>

                                <MultiDataTrigger.Conditions>

                                    <Condition Binding="{Binding CodeOverrideType3, FallbackValue={x:Null}}"

                                               Value="{x:Null}" />

                                    <Condition Binding="{Binding Code3, FallbackValue={x:Null}}"

                                               Value="{x:Null}" />

                                    <Condition Binding="{Binding AppliedCode3, FallbackValue={x:Null}}"

                                               Value="{x:Null}" />

                                </MultiDataTrigger.Conditions>

                                <Setter Property="Text"

                                        Value="{x:Static LocalResources:Label.All}" />

                                <Setter Property="FontStyle"

                                        Value="Italic" />

                            </MultiDataTrigger>

                            <DataTrigger Binding="{Binding ServiceClassCodeOverrideType, FallbackValue={x:Null}}"

                                         Value="{x:Null}">

                                <Setter Property="FontStyle"

                                        Value="Normal" />

                            </DataTrigger>

                        </Style.Triggers>

                    </Style>

                </Run.Style>

            </Run>

        </TextBlock>

    </DataTemplate>

 

The TemplateField of our grid looks like this:

 

<igWPF:TemplateField Name="CodeGroup"

                     Label="{Binding Source={x:Static LocalResources:Label.CodeGroup}, Converter={StaticResource AllCapsConverter}, Mode=OneWay}"

                     Width="Auto"

                     AlternateBinding="{Binding}"

                     DisplayTemplate="{DynamicResource FieldDisplayTemplate}"/>

Parents
No Data
Reply
  • 34690
    Suggested Answer
    Offline posted

    Hello Laura,

    Thank you for your post!

    I have created a sample project that is based on the template that you have provided for your template field, but I can't seem to reproduce this issue you are seeing. I have attached this sample project for you to test on your machine. My tests were made using version 15.1.20151.2055 in Infragistics for WPF 2015.1. Is this the same version you are using?

    When I run the project that I have attached, I am seeing that the values for the "All-All-All" hierarchical child column are consistently there, and they do not disappear after scrolling. If this is the case for you as well, would it be possible for you to please modify the project I sent or provide a sample project of your own that demonstrates this issue that you are seeing?

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XDGTemplateHierarchyCase.zip
Children
No Data