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

PropertyGrid edit entity framework entities, create dynamic rows

1 Answer 63 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
albu
Top achievements
Rank 1
albu asked on 25 Apr 2012, 01:00 PM

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?

1 Answer, 1 is accepted

Sort by
0
albu
Top achievements
Rank 1
answered on 07 May 2012, 08:23 AM
So this is not possible? Still waiting for an answer.
Tags
PropertyGrid
Asked by
albu
Top achievements
Rank 1
Answers by
albu
Top achievements
Rank 1
Share this question
or