Binding Object to Rad Menu

2 posts, 0 answers
  1. Pasquale
    Pasquale avatar
    1 posts
    Member since:
    Mar 2012

    Posted 07 Mar 2012 Link to this post

    Hello Everybody,

    I would like to know if it's possible to bind this type of object to the rad menu:

    class Parent {
      string name
      int id

    class child {
      string name
      int id

    I tried many times without any luck.
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 08 Mar 2012 Link to this post

    Hello Pasquale,

    The RadMenu cannot bind to an object like that because it will not iterate through your List<child> object. The only structure that it would be able to bind to, with regards to a class, would have to look something like this:

    class Item
        string name;
        int id;
        int? parentId;

    Here the parent and child objects are the same class, the only difference being that the child has a value set in it's parentId field, where the parent would have this set as null (this is how it determines what are root elements).

    I hope that explains how the RadMenu binding works.
Back to Top