Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding Context
Message
From
06/02/2003 21:04:44
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Binding Context
Miscellaneous
Thread ID:
00750375
Message ID:
00750375
Views:
55
Hi,

I have a grid and window form controls using VB .Net. I uaed as much of the wizards as I could to elminate lots of coding.

The user selects the row in the grid they want to edit and it displays the rest of the form to edit. Simple.

I used the following code. Its works except when the user sorts a field in the grid. Then the Me.BindingContext(Pending01_DS1, "Listing").Position
does not match the row that was selected from the grid.

The Binding Context position indicates row 36, but the row that was selected (clicked on) is 15. They are out of sync. If I sort by the org seq the position is correct again.

Dim iAddCurrRow As Integer
iAddCurrRow = Me.BindingContext(Pending01_DS1, "Listing").Position

Debug Code=================
MessageBox.Show(CStr(Me.Pending01_DS1.Tables("Listing").Rows(iAddCurrRow).Item("OurListing")) & "...." & CStr(Me.Pending01_DS1.Tables("Listing").Rows(iAddCurrRow).Item("FileNum")), "OurListing...", MessageBoxButtons.OK)
Debug Code================

Dim bOurListing As Boolean
bOurListing = CBool(Pending01_DS1.Tables("Listing").Rows(iAddCurrRow).Item("OurListing"))
If bOurListing Then
EnableOutsideListingControls()
EnableListingReferralControls()
Else
DisableOutsideListingControls()
DisableListingReferralControls()
End If

The above enables the wrong controls because it is not the right row in the bindingcontext....

However it displays the right row in the form controls to edit......................

I am in a real pickle as I have coded all my app this way and I did not noticed the problem until today.

Me.BindingContext(Pending01_Ds1, "Listing").EndCurrentEdit()
Me.SqlDaBuyer.Update(Pending01_Ds1, "Listing")

What do I need to do???????????????????????

Thanks
Roland
Next
Reply
Map
View

Click here to load this message in the networking platform