I am working on a .NET project, and with a Delphi VCL background you really miss a TNavigator for a starter.
So lets build a Navigator ourself. A navigator is a bunch of buttons (First, Prior, Next, Last, Insert, Delete, Post, Cancel etcetera)
A great advance of using a navigator that it encapsulate a lot of code, so that you spare extra code on each form where you use it. It also has the ability to context sensitive act to changes (read events) in the data that it is navigating. So make a control, give him a DataSet and a Table name and go........well it is not that simple!
It is bugging me few days now that I can not find any event in ADO.NET that 'tells' me that the data is edited. I mean at the first keystroke of the user, so that the Post and Cancel buttons of the navigator can become active.
Lets explore some events of the main ADO.NET components:
The datatable seems to me the most logic choice for such an event. It has the following events:
If you examine(try) this events you will notice that they all fire after the actual edit, and that is to late!
The DataView has only a listchanged event which does not help us at all.
The datarow has a property RowState, which changes after an edit occurs, but it has no OnRowStateChange event.
The CurrencyManager manages a list of bindingobjects, and that are our controls. The CurrencyManger has the following events:
They sound promising, but again they fire after the actual keystroke.
So as far as I know there is no event in ADO.NET like the VCL TDataSet BeforeEdit and AfterEdit event. It seems to work in other way in .NET and the only solution I can think of is tracking the OnChange events of the controls on the form.
What am I missing?