Objectdatasource updating event args
In my web page, I've got a Grid View control that is data bound to an Object Data Source. In the event handler for on Updating, the event args object has a cancel property. When this happens, I would like the row that was being updated to remain in the edit mode.The Update Method of the ods is a function that returns an integer and I can get the integer value from the Object Data Source Status Event Args in the ods Form_updated event in my code-beside page.But what about the Output Parameters of the Object Data Source Status Event Args?
I want to initialise my object to load all the old values from the object (rather than a blank object as Object Data Source defaults to). At present I have a kludge to get the data from the Details View control directly - is this the right method? In my test example below I'm using Northwind Customers table. Object Creating 'Load old object using the primary key -- but how to determine pk ? Data Manager(Dsn) Dim cust ID As String ' how to determine this? Protected Sub Object Data Source2_Object Creating(By Val sender As Object, _ By Val e As System. To String 'retrieve from database Dim cust As Test DAL. Then it could update P1 to "B" and P2 is retained as "X". If I clear Data Object Type Name and use an Update() with loads of individual fields, I'm back to writing a whole lot of code to handle the update. My update function is Update(Obj As Test, original_Obj As Test). *if* I could avoid the default constructor, I could pre-build Obj from the database using ID=1, so that P1="A" and P2="X".