Accessing class properties using foreach or any iteration method
-
Hi, I have a class 'C1' with lot of properties with different retun type, and those are set using another class's method 'C2.m1'. i am searching for a technic to get those values using iteration mathod and display in a datagrid, Instead of directly accessing those properties like 'C1.property1'. Could you one please help me..? Thank you Venu.
-
Hi, I have a class 'C1' with lot of properties with different retun type, and those are set using another class's method 'C2.m1'. i am searching for a technic to get those values using iteration mathod and display in a datagrid, Instead of directly accessing those properties like 'C1.property1'. Could you one please help me..? Thank you Venu.
-
Hi, I have a class 'C1' with lot of properties with different retun type, and those are set using another class's method 'C2.m1'. i am searching for a technic to get those values using iteration mathod and display in a datagrid, Instead of directly accessing those properties like 'C1.property1'. Could you one please help me..? Thank you Venu.
Sounds like you want a PropertyGrid then. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use < PRE > tags for code snippets, it preserves indentation, and improves readability.
-
Hi, I have a class 'C1' with lot of properties with different retun type, and those are set using another class's method 'C2.m1'. i am searching for a technic to get those values using iteration mathod and display in a datagrid, Instead of directly accessing those properties like 'C1.property1'. Could you one please help me..? Thank you Venu.
Well a DataGridView control does reflection automatically. If you have a collection of 'C1' objects that implements the IList interface, then any public property will automatically be extracted and used to populate the cells in the apropriate column. Does this help? Harry.