TreeListView using XML

3 posts, 0 answers
  1. Murray Eaton
    Murray Eaton avatar
    3 posts
    Member since:
    May 2010

    Posted 02 Aug 2010 Link to this post

    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. Murray Eaton
    Murray Eaton avatar
    3 posts
    Member since:
    May 2010

    Posted 02 Aug 2010 Link to this post

    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!
  3. UI for WPF is Visual Studio 2017 Ready
  4. Russ
    Russ avatar
    25 posts
    Member since:
    Oct 2008

    Posted 03 Aug 2010 Link to this post

    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.

Back to Top