Alex
Alex

Reputation: 69

WPF XamdataGrid Optimizing

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?

Upvotes: 0

Views: 833

Answers (1)

Tobias
Tobias

Reputation: 232

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?

Upvotes: 1

Related Questions