Tree definition issues

Topics: Troubleshooting
Apr 8, 2011 at 4:17 PM

I have troubles defining a data application tree. According to this tutorial C1 should catch the XML file when it is located in the "TreeDefinitions" folder in App_Data

This doesn't happen for me

Here is my XML which is taken from the tutorial as well:

<?xml version="1.0" encoding="utf-8"?><ElementStructure xmlns="" xmlns:f="">
  <ElementStructure.AutoAttachments>    <NamedParent Name="Content" Position="Bottom" />  </ElementStructure.AutoAttachments>
  <ElementRoot>    <Children>
      <Element Label="Slægtstræ" Icon="perspective-users" Id="SlaegtsTrae">        <Children>          <DataElements Type="Tree.Family.Members" Icon="pagetype-pagetype">            <OrderBy>              <Field FieldName="Name" Direction="descending"/>            </OrderBy>            <Actions>              <EditDataAction/>              <DeleteDataAction/>            </Actions>          </DataElements>        </Children>         </Element>    </Children>  </ElementRoot></ElementStructure>

A possible issue could be that I want it to be in the data perspective and I have not defined wether it should be in Global datatypes or other. But it doesn't work in Content perspective either?

I open the Website folder as a website in VS2010 Express as there is no solution (.sln) file in the zip file from codeplex as described

Apr 8, 2011 at 10:39 PM

Try getting the logger up and running and make a re-save to your XML file - if there is something wrong with the file, it will not show up in the thre, but the logger will have pretty decent info about what to fix.

The logger is available here:

Apr 9, 2011 at 12:11 AM
Edited Apr 9, 2011 at 12:26 AM

Also try removing non-standard characters i.e. æ from the attributes etc and see if that fixes the issue (codepage bug)

Aside: When pasting code please use the code editor function of the WYSIWYG in codeplex (rightmost toolbar icon) because it makes it prettier:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text.RegularExpressions;
using System.Web.UI;

/// <summary>
/// Summary description for GenericFilter
/// </summary>
public abstract class GenericFilter<T> where T : ISortableComparable
    /// <summary>
    /// Based on the type passed in we can determine the fields available for filtering.
    /// </summary>
    private Dictionary<string, List<Filter>> _availableFilterFields = new Dictionary<string, List<Filter>>();
    public Dictionary<string, List<Filter>> AvailableFilterFields
        get { return _availableFilterFields; }
        private set { _availableFilterFields = value; }


etc etc

Apr 11, 2011 at 7:56 AM

Ok now it works. The bug was danish letters and an AddDataAction with no Type attribute. I got the logger running, very informative!

But it seems it is not possible to make a "normal" tree structure with datatypes. I don't believe it is possible to ADD a dataelement to another dataelement and see the correct inheritance. whether you use DataElements or DataFolderElements.

The reason is that a DataFolderElement needs an argument like FieldGrouping name. But this won't work when you get to level 3 and the FieldGroupingName is level1

To make a long story short I will make my tree with pages and use metadata. But do You have an example of a tree structure with datatypes (global or page) with say 5-7 levels PLEASE let me see that XML

Apr 11, 2011 at 2:05 PM

Please see - should help you with getting the desired the folder/item setup.