Reading Object Property

  • Thread starter Thread starter Hon Yuen, Ng
  • Start date Start date
H

Hon Yuen, Ng

Hi:

May i know if it is possible to retrieve the declared (public) property
in a object without knowing the class type? I've seen a component doing
similiar thing (DevExpress's XtraGrid). The grid can be populated by
using a list of objects.

Thanks in advance.

From,
Hon Yuen, Ng
 
Yes, through reflection: you get the Type with MyObjectInstance.GetType() or
GetType(MyClass) and the you use Type.GetProperties or similar methods of
Type.
--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top