Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello Everyone,

I have a PropertyGrid bound to an object returned by a WebService. The object(of type Customer) contains unother object(of type Address). The object of type Address becomes expandable in the PropertyGrid only after inserting the line [TypeConverter(typeof(PropertyConverter))] before Address object declaration in Reference.cs file.
Is it possible to persist this behaviour after updating the Web Reference?

Thank you,
C#
private System.Windows.Forms.PropertyGrid prop;
ExampleWebService ws = new ExampleWebService();
Customer cust = ws.GetCustomer();
prop.SelectedObject = customer;

C#
[WebMethod]
public Customer GetCustomer()
{
    Customer customer = new Customer();
    return customer;
}

C#
[TypeConverter(typeof(PropertyConverter))]
public class Address
{   ...   }
public class Customer
{
    public Address MailingAddress
    {    ... // get, set   }
}
public class PropertyConverter : ExpandableObjectConverter
{
    public override object ConvertTo(...)
    {   ...   }
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900