Hello everybody,
I started to use the ProjectEdit functionality exposed by Rocky in WEB ProjectTracker project. But DetailsView control give me an ugly issue: Insert and Update are working fine only for the first press of these buttons. My object has errors so, when I press insert button first time, all error are displayed properly in label error. If I will press insert button again, details view become invisible.
Bellow is the list of events when I press insert button first time:
1. DetailsView1_ItemCreated. It allows to fill values of controls from DetailsView:
If DetailsView1.DefaultMode = DetailsViewMode.Insert Then Dim obj As RootObject = GetObject() ------------- EndIf
2. BusinessRootDataSource_InsertObject. It calls Save method that returns 0 reccords affected and set properly text of label error.
3.DetailsView1_ItemInserted is invoked: it keeps DetailsView in insert mode: e.KeepInInsertMode = True
This is the right behaviour!
Second time when I press Insert Button, DetailsView1.DefaultMode is ReadOnly and DetailsView become invisible. BusinessRootDataSource_InsertObject and DetailsView1_ItemInserted are skipped! DetailsView1.Rows.Count became 0!
A similar behaviour has Cancel Button also. First time is working properly, but, the second time when is pressed it sets displayview default mode in readonly
Many Thanks and HNY for all of you!