This is a migrated thread and some comments may be shown as answers.

TreeListView using XML

2 Answers 74 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Murray Eaton
Top achievements
Rank 1
Murray Eaton asked on 02 Aug 2010, 09:07 PM
There is probably a simple answer to this, however I am a designer and have had no luck finding an answer to this via google or the support pages.

I am needing to use a RadTreeListView to show the following heirarchy:-

  • Calculation Set 1
    • Calculation 1
      • Condition 1
    • Calcualation 2
      • Condition 2
    • Calculation 3
      • Condition 1
  • Calculation Set 2
    • Calculation 4
      • Condition 1

Here is my proposed XML:

<?xml version="1.0" encoding="utf-8"?>
<Calculations>
  <Calculation_Set Name="Calculation Set 1">
    <Calculations>
      <Calculation Name="Calculation1">
        <Conditions>
          <Condition Name="Condition 1"/>
          <Condition Name="Condition 2"/>
          <Condition Name="Condition 3"/>
        </Conditions>
      </Calculation>
      <Calculation Name="Calculation2">
        <Conditions>
          <Condition Name="Condition 4"/>
          <Condition Name="Condition 5"/>
        </Conditions>
      </Calculation>
    </Calculations>
  </Calculation_Set>
  <Calculation_Set Name="Calculation Set 2">
    <Calculations>
      <Calculation Name="Calculation2">
        <Conditions>
          <Condition Name="Condition 6"/>
          <Condition Name="Condition 9"/>
          <Condition Name="Condition 12"/>
        </Conditions>
      </Calculation>
    </Calculations>
  </Calculation_Set>
</Calculations>


Can I get some help with the creation and binding?

2 Answers, 1 is accepted

Sort by
0
Murray Eaton
Top achievements
Rank 1
answered on 02 Aug 2010, 10:01 PM
I would also like to know how to default the "Calculation Set" and "Calculation" nodes to Open.

Thank you so much for taking the time to help with my novice questions!
0
Russ
Top achievements
Rank 1
answered on 03 Aug 2010, 07:29 PM
Hi Murray,

I just happened on your post while looking for some other help.   But might offer a little advice. First, from the looks of your XML, it doesn't seem like RadTreeListView is the answer.  

From what I've seen, the RadTreeListView is intended more for times when the different levels are the same type of item.  Your XML seems to represent different types of items. This may fit better into a different structure.  If the XML won't have any additional data, you mght want to look at the RadTreeView instead.   Take a look at the WPF demos, under Navigation - TreeView - Data Binding.  I think this is what you are looking for,

On the other hand, If there will be additional data with each of the nodes, then it seems like a regular RadGridView may be better suited.  With the Main part of the grid related to the "Calculation Set"s  and then having a master-detail relationship to a child grid of "Calculations" and then another master-detail relationship to the "Conditions".   Take a look at the WPF GridView Heirarchy demo for a sample.  This only goes to one detail level, but another detail level can easily be added.

Good Luck,
Russ.

Tags
TreeListView
Asked by
Murray Eaton
Top achievements
Rank 1
Answers by
Murray Eaton
Top achievements
Rank 1
Russ
Top achievements
Rank 1
Share this question
or