Asp net objectdatasource updating
Cheers It's not a bug, looks like it is more like a design feature [: P] And yes I have thought many times why it isn't more extensible...
How do you guys update let's say for example a Form View with an Object Data Source source.
Finally I databind Form View again to display new values on the form.
Of course, I have built some automation there, so I do not have to do this manually. Doesn't it seem a little silly to be put through so much pain when there should be an easier way? I'm still curious to know if this is a bug or a design feature, if its a designb feature what is the logic behind it?
Row Updating() fires and you can use it to check the user's input values for bogus or dangerous data that you don't want to save to the DB. Row Updated() fires letting you know the update is complete, and you can rebind the Grid View to see the updated data in the UI. I'm not sure why you aren't using the buttons that are provided. I'm discussing using a Grid View and Details View with SQLData Sources, but the discussion is the same. i see that you are not using objectdatasource and here is what i'm trying to do in my grid i have few textbox and dropdownlist i have my own custom buttons for insert, update, delete.. - If you are wired to a Business Logic Layer, then you have to create a method in the BLL that will do the update for you. These were done automatically for me because I wired directly to a Table Adapter.
User edits a row and clicks the Update link (or button) 5. You need to enter the update information into the ODS control. Using the ODS's smart tag, select Configure Data Source. Choose your business object (in your example, this should already be done, so just click Next). Click on the UPDATE tab and choose a method that will update the database: - If you are wired directly to a Table Adapter, then there should be a method to choose from in the drop down list. Now that you have an Update method specified in the ODS, when the user edits a row and selects the Update button, the Grid View will automatically save the edits to your database, and since it causes a postback, the Gridview will update as well. The table in my database has 5 columns: Event ID, Source, Event, Type and Code. Look carefully at the ODS in my example; you will see there are entries for Delete, Update, and Insert.