Dynamic Forms in C# (Part 2)

Download DynamicForm.zip (18 KB)

Hope everyone had a good Christmas break. I thought I’d start the year with an update to my previous post on dynamic forms. My intention is to keep extending this control over the course of the year, I’ve already started using it in other projects so with luck I’ll be motivated to keep developing it.

The change I’ve made today is the addition of a RequiredField attribute for string properties. This ties in to a new ErrorProvider object in the form that shows the standard error icon next to missing fields. Rather than use dialog boxes, I’ve decided to simply disable the “OK” button if the form has missing fields:

Full source code is available (C# VS2010):
Download DynamicForm.zip (18 KB)

Advertisements
This entry was posted in Projects and tagged , . Bookmark the permalink.

3 Responses to Dynamic Forms in C# (Part 2)

  1. hoangitk says:

    It’s very helpful!
    Good post!

  2. Chris Anders says:

    good work, can you implement more datatypes? And To Add own controls with Attribute

  3. Chris Anders says:

    i addet some extra features: Textarea, TitleAttribute

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s