Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MmButtonNew
Message
De
23/12/2009 11:03:16
 
 
À
22/12/2009 20:47:36
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Versions des environnements
Database:
MS SQL Server
Divers
Thread ID:
01440219
Message ID:
01440348
Vues:
38
It is most definitely the sort order messing things up. I took the sort order out and the New button functioned perfectly.

I haven't looked into the framework source yet, but I was trying to go the route of using the RowAdded event of the grid view:


Private Sub dgvSummary_RowsAdded(ByVal sender As System.Object, ByVal e As _
System.Windows.Forms.DataGridViewRowsAddedEventArgs) Handles dgvSummary.RowsAdded

Me.BindingContext(Me.mdacAttorney.GetCurrentDataSet(), "Attorney").Position = dgvSummary.Rows.Count

SelectGridRow(e.RowIndex)

...


SelectGridRow() is a function I added that basically just manually sets the selected grid row and ensures the scroll position is set so that the selected row is actually in view. This method works. The newly added row does become selected. However, my attempt to update the BindingContext position in the prior instruction fails, and so the very last record in the grid gets loaded into the detail view. Obviously this is not good when trying to add a new record.

For position values I tried the grid row count (as above), the grid row count - 1, and also e.RowIndex. NONE of these work. In all cases the last record of the pre-existing data is loaded into the detail view.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform