Expression Editor: Multiple Objects

4 posts, 1 answers
  1. Ron
    Ron avatar
    4 posts
    Member since:
    Oct 2011

    Posted 19 Oct 2011 Link to this post

    Is it possible to give the have the Expression Editor pull properties from multiple object for the fields in the tree view?  Also, is it possible to make the Editor check if child objects of the object it is passed have properties?

    Thank you very much
  2. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 21 Oct 2011 Link to this post

    Hi ,

     Currently this is not possible. Possible approach will be to provide new class combining all needed properties from all classes. 

    Greetings,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Ron
    Ron avatar
    4 posts
    Member since:
    Oct 2011

    Posted 21 Oct 2011 Link to this post

    Would you happen to know if there is a was to dynamically generate this composite class? I have tried using a dynamic object class and also an ExpandoObject but have not had luck with either.

    Thanks Again
  5. Ron
    Ron avatar
    4 posts
    Member since:
    Oct 2011

    Posted 21 Oct 2011 Link to this post

    Correction, I was able to get an expandoObject to work.
    public object MakeComposite(List<object> objects)
    {
        dynamic composite = new ExpandoObject();
     
        ExpandoObject e = composite as ExpandoObject;
     
        foreach (object obj in objects)
        {
            foreach (PropertyInfo info in obj.GetType().GetProperties())
            {
                (e as IDictionary<string, object>).Add(info.Name, info.GetValue(obj,null));
            }
        }
        return composite;
    }
Back to Top