Customs Fields at runtime for XAF

This will be a really short post. When presented with a XAF challenge the first thing I do it is a quick search trough the support tickets to see if there is already an implementation that I can adapt to my needs. Most of the time I find something that I can use, but also most of the time I have to actually code it and run it to see if it is exactly what I need it.

If you are like me, you would love to have a visual before getting to deep and realizing I am on the wrong path. I also realize DevExpress receives tons of tickets daily so this is not feasible for them.

I had a request for some custom fields added in run time in a XAF Windows app and I found these tickets that helped me a lot:

https://www.devexpress.com/Support/Center/Question/Details/T284822/how-to-create-business-classes-at-runtime-based-on-predefined-configurations-or-allow

https://www.devexpress.com/Support/Center/Question/Details/E1806/how-to-add-custom-properties-to-a-detailview-dynamically-at-runtime

My solution is actually the one from the .zip in the second ticket and I only implemented Windows but they have Web there as well.

They have it mark as obsolete now (not completely sure why) but in my case it did the job. (Isn’t that the goal)

Well, this is my end result:

Source Code:  https://github.com/jjcolumb/CustomFieldsDemo

Until next time, XAF out!

 

Posted in XAF

Leave a Reply

Your email address will not be published. Required fields are marked *