Binding in WPF optimalization problem, DataTemplate

DanSo1
DanSo1 used Ask the Experts™
on
I need to optimize my bindings. What I need to achieve is less memory usage. Now I've got in my view binding like this:

    <DataTemplate x:Key="COTLineTemplate">
      <CheckBox IsChecked="{Binding Path=TypeIncluded}"
        Content="{Binding Path=TypeDescription}"
        HorizontalAlignment="Left"
        VerticalAlignment="Center"
          >
      </CheckBox>

later:

 <ItemsControl
        ItemsSource="{Binding COTExpanded}"
        ItemTemplate="{StaticResource COTLineTemplate}"
        />

Everything working now, but my ItemsControl is a adorner control in some DataGrid. For one field in that DataGrid I'm displaing adorner control with items (from 6 to 30) build by ItemsControl.
If we will have tousands of rows in DataGrid we will use to much memory for it. What I want to do is to change my class COTExpanded which part of it looks like below:

        public string TypeDescription
        public bool TypeIncluded

But the most important thing is that TypeDescription is the same for all rows and TypeIncluded is different.
So for every row we have list of COTExpanded which should become the list of bool TypeIncluded and ONE static list of description.

If something is not clear just ask.




Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Would be just awesome, if you would provide more code =)
But since that i would say few things:
1. If you want to use less data loading, use specific views that can cover all your data (including lookup resolved fields)
2. You shouldnt be bothered with user used memmory, unless it's more then 300Mb (with all my statistic on Silverlight applications i have, users dont bother with memory used until it's starts freezing UI)
3. Actualy i had project where 1Ml row were sorted on user side with more complex columns then you had (just a quick project solution), but still that wasn't a problem for user unless its was W2k User w., SL2 on 512Mb of memory :P

If you can give more description on task would be great.

Author

Commented:
OK, more description.
I have xamDataGrid. In that grid I have one field which is edited by adorning editor. This adorning editor is done by ItemsControl which I've attached before.
What I'm thinking about is to bind to parent object - by using RelativeSource  FindAncestor etc.
But then my list of descriptions must be connected so how with the list of bool's.

Author

Commented:
Not solving my problem but many thanks for trying to help me.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial