Accessing Property's FriendlyName from GUI

Accessing Property's FriendlyName from GUI

Old forum URL: forums.lhotka.net/forums/t/6739.aspx


lukky posted on Saturday, April 04, 2009

Hi,

How can we access a PropertyInfo's FriendlyName from the GUI ? For example, if I want to use that as Header text for DataGridView columns. Is there a pattern for such use ?

Thanks

RockfordLhotka replied on Monday, April 06, 2009

I've been making my PropertyInfo<T> fields public lately. Mostly because that makes them available to my ObjectFactory objects, but it would also make them available to the UI to get metadata about the object's properties too - though the UI would probably need to use reflection to find the static fields.

Another approach is to use the GetRegisteredProperties() method on the field manager. FieldManager is a protected property of BusinessBase, and it exposes a GetRegisteredProperites() method. You could choose to expose this as a public member of your business object(s) so the UI can easily get a list of the properties registered for your object.

lukky replied on Tuesday, April 07, 2009


Thanks Rocky, I'll look into it.

Copyright (c) Marimer LLC