This is a migrated thread and some comments may be shown as answers.

RadPropertyGrid and MVVM

0 Answers 106 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
centuit
Top achievements
Rank 1
centuit asked on 05 Apr 2012, 02:25 PM
Hi,

I have a project that involves using a PropertyGrid in a MVVM model. I have searched and could not find an example.
I need to change PropertyDefinitions dynamically at runtime, meaning bind to a list of definitions at runtime.

Example: (This code does not work, how can I make it work ?)

// class that holds each definition
 public class MyProperties
    {
        public string DisplayName { get; set; }
        public string GroupName { get; set; }
        public string Description { get; set; }
        public object Value { get; set; }
    }

  public class MainViewModel
    {
// property that is bound to the "Item" property in RadPropetyGrid control
        public object CurrProperties { get; set; }

        public MainViewModel()
        {
var list = new List<MyProperties>();
            list.Add( new MyProperties
                {
                    DisplayName = "String Property",
                    GroupName = "MyGroup",
                    Description = "This is a test for a string property",
                    Value = "My String Value"
                });

list.Add(...

CurrProperties = list;
        }
    }


Thanks
Tags
PropertyGrid
Asked by
centuit
Top achievements
Rank 1
Share this question
or