473,573 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
following:

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
DataSource

frmDEMasterDeta il - 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 frmDEMasterDeta il.

The problem i have is on frmMasterDetail :

let's say that on FormA, inherited from frmDEMasterDeta il, 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.

Marcy.

Dec 7 '05 #1
0 1328

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8001
by: Jason Hickey | last post by:
Has there been a change in the way the UI designer handles winform inheritance in the 2003 version of visual studio. Consider the following (try it if you are using 2003 Everything seems to work under 2002) Create a form and add two buttons (bottom right) and a panel (fill the top of the form) Anchor the buttons to the bottom right and...
3
4521
by: SteveK | last post by:
I have a text box and I simply want to bind it to an int variable. I'm testing how all this stuff works and I wanted to test if I increment the int, will the textbox update automatically, however I didn't get far cause I can't get binding to work with an int OR I should say it wants an object and a member.. Any tips or heads-ups? ...
0
1385
by: r_elbers | last post by:
Hello, Does anybody know about some docs about real internals off databinding ? Old DDX was clear enough about when to expect what event, but it isnt very clear when the first update of a databinding,once defined is triggered. Ofcourse if you go form_load everything is done, but for instance in my testcode I dont want to show anything,...
9
2673
by: HAN(removethis)twister | last post by:
I've tried to create 11 textboxes as variables (not actually visible in the program, not in Windows Form Designer) and have set DataBindings to the text properties of the TextBoxes BUT according to tests I've run, it says that the DataBindings exist, but the IsBinding is set to False, and is ReadOnly (the bindings exist, they just aren't...
1
5992
by: Ariel Gimenez | last post by:
Hi i want to know how to do this: i have a combobox in my app that is allready binded to a datatable and has it properties valuemember and displaymember now i want at runtime to assign to it another table... this is the code im ussing in order to assign the new datasource but it throwns an exception : unable to bind to a new valuemember ...
2
9335
by: C Glenn | last post by:
This is admitedly vague. But so is my understanding of the problem. I'm using this chunk of code: retControl.DataBindings.Add(ctrlBinding.PropertyName,DataSource,BindingField); This resolves to something like: Control.DataBindings.Add("Text", SomeDataTable.Rows, "Priority"); The only difference that I can see is that one of the...
4
1294
by: gregory_may | last post by:
I have a regular windows forms application that I need to automatically fill in some information into..... But the manufacture has no published API's or web services. Everything must be via their GUI. Is there some technique that would allow a .Net program to fill in any winforms text box with some information (from my own database pull)? ...
0
2294
by: XenReborn | last post by:
Ok this should be simple. I made a form, added a combobox (for selecting items to edit, not for updating fields), several textboxes, a few checkboxes etc. On formshow it connects to my database, draws down the existing data, no problem. All the records in the datatable that were the result of a query, I could select from, and the other databound...
6
1196
by: GiJeet | last post by:
Hello, I'm working on a winforms app that will be used in stores in different states and each state can have different data capture requirements. I want to create a base form for for all the common data and wish to use visual inheritance to subclass the different forms that need to capture specific data for each state - but I don't want to...
0
7741
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7661
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7978
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8167
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7730
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2164
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1263
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.