PropertyGrid edit entity framework entities, create dynamic rows

2 posts, 0 answers
  1. albu
    albu avatar
    7 posts
    Member since:
    Mar 2009

    Posted 25 Apr 2012 Link to this post

    Hi,

    It is somehow possible to display/edit an EntityCollection of entities?

    My entity looks like that:

    public partial class Property : EntityObject
    {....
      public string Name {set;get}
      public string Description {set;get}
      public string Value{set;get}
      public string RegExValidationString{set;get}
    }

    And I want to be able to edit a collection, each object in the collection to be displayed as an row in the PropertyGrid:

    EntityCollection<Property> entityCollection = new EntityCollection<Property>();
    entityCollection.Add(new Property() { Name = "test1", Description = "test1 description", Value = "111" });
    entityCollection.Add(new Property() { Name = "test2", Description = "test2222 description", Value = "lallla" });
    I tried by adding PropertyDefinitions, but I'm not able to edit values:

    foreach (Property p in entityCollection)
    {
        PropertyDefinition pd = new PropertyDefinition() 
        
            Binding = new Binding { Source = p.Value }, 
            DisplayName = p.Name, 
            Description = p.Description 
        };                
     
        radPropertyGrid.PropertyDefinitions.Add(pd);
    }
    Is there another way to do this? Do you have any examples?

  2. albu
    albu avatar
    7 posts
    Member since:
    Mar 2009

    Posted 07 May 2012 Link to this post

    So this is not possible? Still waiting for an answer.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top