Hello friend,
Hope someone can help me on this:
I am facing with a issue when binding propertyGrid with 'interface type' in ViewModel class:
public class MainViewModel {
public IParent Parent
{
get;
set;
}
public Parent : IParent
public Parent(string name, IChild child)
this.ParentName = name;
this.Child= child;
string ParentName {get;set;}
IChild Child {get;set;}
public class Child : IChild
public string ChildName {get;set;}
public int Age {get;set;}
public interface IParent
public interface IChild
string ChildName {get;set;}
int Age {get;set;}
and when bind it to PropertyGrid
MainViewModel vm = new MainViewModel();
vm.Parent = new Parent() { ParentName = "ParentName", Child = new Child(){ChildName = "ChildName ", Age = 3} };
propGrid1.SelectedObject = vm;
then I can expand Parent but I can NOT expand 'Child'' properties.
I am confused what wrong I am going now? Could someone please give me an explaination.
Thank you,
BR
Hello Binh,
I am just checking if my last reply was helpful for you.
If you have any further questions on this matter please do not hesitate to let me know.
Sincerely,
Horen
Software Developer
Infragistics
Thanks for your feedback. I have been looking into it and just to be clear in order to be able to achieve the functionality you are looking for, what I can suggest is to make your properties in the Parent to be public instead private. Here is a snippet.
public class Parent : IParent
this.Child = child;
public string ParentName { get; set; }
public IChild Child { get; set; }
I have attached an updated project.
Dear Horen,
I am sorry for long response, I highly appreciate your support. I follow your instruction to request this new feature on your website
Once again, thank you very much
Binh
Hello,
If you require any further assistance please do not hesitate to ask.
If you change the properties of the Parent class to public tell will show up in the property grid. I have attached an updated sample.
Thank you for contacting Infragistics.