Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmButtonNew
Message
From
23/12/2009 11:03:16
 
 
To
22/12/2009 20:47:36
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Environment versions
Database:
MS SQL Server
Miscellaneous
Thread ID:
01440219
Message ID:
01440348
Views:
37
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform