Information générale
Catégorie:
The Mere Mortals .NET Framework
<--Try adding this to the button's click event handler:
this.NavigateData(mmNavigate.Last, false);
This is the code that is used for the mmMaintenaceForm's New button -->
Still I have a problem. First, the method does not accept a 2nd parameter, but no problem. Second, If I'm sorting on a column other than the primary key, I get in the wrong position.
After debugging your code (and thank God we have it), I notice that you're issuing a new row on the dataset itself. Then, keeping a reference to the new row (It actually wasn't, but I fixed this bug). The binding manager, on the other hand, is using dataviews, and I'm struggling to find a way to locate the row representation in the dataview. I cannot even determine its position in the table itself!
A workaround to this would be, using the CurrencyManager's AddNew() method (If not suggesting creating one of our own, which is better). This will add a new row to the dataview and set the current record to the new position. Now, what happens to the business object? Well simply, you could hook events to whatever dataset's table assigned to the business object. Then call the appropriate operations from there. This will eliminate some problems, when for example, the user sets the current dataset to one of his own and then using a backdoor call to insert a new row to that dataset without using the NewRow method of the business object.
What do you think?
Thanks
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement