471,317 Members | 1,339 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

WinForms, Inheritance and DataBindings

Hi all,

i'm a reader of this NG from a long time and i should say that it was
really useful in my learning process on c#.
Now i'm writing a family of WinForms that should be used by a
developers team to write applications. The WinForms hierarchy is the

frmDEBaseForm: Data Entry Base Form - simply introduce a custom
DataNavigator (not the one shipped with Vs2005, but one written by
myself) with classic operations (First, Prev, Next, Last, Edit, New,
Save, Cancel, etc etc). The datanavigator enables or disables button
depending by the connected datasource (i.e: if in editing mode,
browisng buttons ar disabled, or if in browsing mode, Save and Cancel
buttons are disabled, or, if the datasource is empty, only the New
Record Button is enabled)

frmDESingle: Single Entity Data Entry, Inherited from Base Form, that
introduce a CurrencyManager and shoud be used to manage just a single

frmDEMasterDetail - Master Detail Data Entry, Inherites from Base Form,
similar to frmDeSingle, but with functionality to manage Master/Detail
Situations, and then two currency manager and etc etc

and so on....

The developers, of course, to implements theri forms, will never
inherit directly from frmDEBaseForm, but, depending by their needing,
they will inherit from frmDESingle or frmDEMasterDetail.

The problem i have is on frmMasterDetail:

let's say that on FormA, inherited from frmDEMasterDetail, i have 2
TextBoxes, Text1 bound to a field of the master datasource, and Text2
bound to a field of the detail datasource. I want give to frmDEBaseForm
(or at least to the frmMasteDetail) the functionality to update the
DataNavigatory autimatically depending by the control that has the
focus. Example: if the detail datasource is in editing mode, when Text2
receive focus the DataNavigator automatically updates the buttons. Of
course i don't want to force the programmer to write an Enter event
handler for every control that he uses on his form and that he binds to
a datasource but i'd like that this "behaviour" is smth of automatic
introduced and managed by the ancestor forms. Well, i have no clue on
how to implement that and any hint would be greatly appreciated, even
links to cases to examples that u think might help me.

Sorry for the length of this post and for my poor english and thanks in
advance that u will give me.


Dec 7 '05 #1
0 1262

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jason Hickey | last post: by
3 posts views Thread by SteveK | last post: by
reply views Thread by r_elbers | last post: by
9 posts views Thread by HAN(removethis)twister | last post: by
2 posts views Thread by C Glenn | last post: by
6 posts views Thread by GiJeet | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.