Developing a control that interrogaets other controls at design time..

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,081
Programming Experience
10+
I have an idea for a component that I want to develop to drop on my form in order to simplify some binding problems I'm hitting.

The idea would be to drop this copmponent (which has no visual element, like a bindingsource or tableadapter is) onto the form and tell it which bindingsource and tableadapter to use.

It would then Interrogate both the bindingsource and the tableadapter and generate a list of controls that are bound to the datasource. Using the insert/update parameter colelctions, it would deduce which bound elements are updated (not all my bound elements are updated) or inserted.
It would then generate lists of which controls are to be enabled or disabled depending on whether (at run time) the bindsource.current is pointing to a Modified or Added row (because we dont want the user editing a control that is bound to a property that isnt sent to the db during an update; they will get confused why the database doesnt save their data). The list of controls would be user tweakable (after auto generating) in the property grid.

I see that design time interrogation is possible because a DataGridView draws column headers when it is bound to a typed datatable..

Thing is, I have no idea of the level of effort required to do this. Can anyone give me a clue, and maybe some pointers or articles to read to set off in the right direction?

Thanks in advance
 
Back
Top