c# - Binding to interface and displaying properties in base interface -


(with its answer) states that you can not easily tie a DataGridView for an interface type and get inherited Can get columns for properties from the base interface.

The suggested solution is to implement a custom type converter. My endeavor is below, although creating a datasource and datagrid view bound for ICAM, still results in a column (Humps) I do not think ICAME My converter is being used by NAT to decide which properties can be viewed for. What am i doing wrong

  [Type Kanwar (Typhon (Miconver)) Public Interface IAnimal {string name {get; Set; } {Get; Set; }} [Correspondent (typef (miconwar))] public interface iCamell: iGoogle {int heps {receive; Set; }} Public class MyConverter: TypeConverter {public override property dictionary GetProperties (ITypeDescriptorContext context, object value, attribute [] attributes) {if (value type & amp; type) value == type (ICamel)} {list & lt ; PropertyDescriptor & gt; PropertyDiscriptor = new list & lt; Property descriptor & gt; (); Foreign currency (TypeDisptor. Type in Properties (Typfix (Icmail))) {propertyDescriptors.Add (pd); } PropertyDescriptor PD {propertyDescriptors.Add (pd);} New Property Decatur Collection (PropertyDiscriptors.Tower ());} Return Base .net Properties (Reference, Value, Attribution);} in Foreach (TypeDescriptor.GetProperties (typeOf (IAnimal)); Public Override Bull GetPropertiesSupported (ITypeDescriptorContext Reference) {return true;}}  

DataGrid view does not use TypeConverter ; PropertyGrid TypeConverter .

If this list is appointed If the ron is related to DataGridView , then the other answer is incorrect.

To provide custom properties in the list, you need one of these:

< Ul>
  • at the data source ITypedList <
  • typewriterproducer
  • Both are non-trivial.


    Comments

    Popular posts from this blog

    c++ - Linux and clipboard -

    What is expire header and how to achive them in ASP.NET and PHP? -

    sql server - How can I determine which of my SQL 2005 statistics are unused? -