0

I have a problem with optimisation the xamdatagrid. I'm trying use this http://www.infragistics.com/community/blogs/kiril_matev/archive/2010/10/26/optimizing-xamdatagrid-performance.aspx

But when I download styles for the controls I have got the error Object reference not set to an instance of an object.

You can see this on screenshot. enter image description here

or this. Line:336

<Setter Property="TemplateCardView">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type igDP:DataRecordPresenter}">
                <igWindows:CardPanel x:Name="baseGrid" Background="{TemplateBinding Background}">
                    <!-- Record Content -->
                    <Rectangle Fill="{DynamicResource {ComponentResourceKey {x:Type igDP:XamDataGrid}, CardBackground}}" />
                    <ContentPresenter x:Name="PART_RecordContentSite" Content="{TemplateBinding DataContext}" ContentTemplate="{TemplateBinding {ComponentResourceKey {x:Type igDP:DataRecordPresenter}, RecordContentAreaTemplate}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                </igWindows:CardPanel>
            </ControlTemplate>
        </Setter.Value>
    </Setter>

error indicates to <ControlTemplate..>

and if I remove

Fill="{DynamicResource {ComponentResourceKey {x:Type igDP:XamDataGrid}, CardBackground}}"

error will not be

Please tell me what is wrong?

1
  • Are you using the styles from the sample Kiril provided in the blog post or did you start with the Default Styles for the version of the control that you are currently using which are installed by default? Also do you have an example project that already reproduces the issue? If so, can you post it somewhere? Commented Aug 27, 2013 at 21:48

1 Answer 1

1

Try the following:

<Rectangle Fill="{DynamicResource {ComponentResourceKey
TypeInTargetAssembly={x:Type igDP:XamDataGrid},
ResourceId=CardBackground}}" />

and i think you will have a property for the CardBackground, perhaps you have an error like the guy in the following question: Getting a ComponentResourceKey to Work?

Sign up to request clarification or add additional context in comments.

2 Comments

whats on line 327 and 495 in your xaml?
Answer edited! Perhaps the link to the following question could help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.