Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
Binding class to UltraTree (no columns)
posted

Hello,

I want to bind custom class, ex.:

   public class Entity
   {
      private static int count = 0;

      public int Int { get; set; }
      public string Name { get; set; }
      public EntityList List { get; set; }

      public Entity(string name)
      {
         this.Int = count++;
         this.Name = name;
         this.List = new EntityList();
      }
   }

   public class EntityList : List<Entity>
   {
   }

I want to display Name just name properties as simple nodes (without cells), so I set ultraTree1.ViewStyle = Standard;

After filling up the EntityList object I bind it to a tree, to have it displayed but what I get is only columns of integer numbers (from Int property).

I tried adding column set:

         UltraTreeColumnSet columnSet = new UltraTreeColumnSet();
         columnSet.Key = "Name";
         columnSet.Columns.Add("Name");
         ultraTree1.ColumnSettings.ColumnSets.Add(columnSet);

         ultraTree1.NodeLevelOverrides[0].ColumnSet = columnSet;
         ultraTree1.NodeLevelOverrides[1].ColumnSet = columnSet;

but I saw only parent nodes of UltraTree (first level only).

How to set UltraTree to display this collection properly?