Edititemtemplate not updating

31-Jan-2018 11:54 by 5 Comments

Edititemtemplate not updating

This can be beneficial to other community members reading the thread. I have a Grid View that uses an Object Data Source.

It will be easy to reply if we could see the code... My api is returning a list of shopping cart objects that binds to gridview of cart rows.

If that still doesn't help, you can post your exception message and stack trace here.

Sincerely, Kevin Yu Microsoft Online Community Support Please remember to click “Mark as Answer” on the post that helps you, and to click “Mark as Not Answer” if a marked post does not actually answer your question. Grid View Update w/ Object Data Source: Getting a reference to updating object?

I've put some code in the page load so that when the user enters text into the textbox it changes select command for the datasource so that the select command has a WHERE in it and then changes select command back when there is no text in the text box.

It updates the datasource but it doesnt refresh the gridview.

Howdy, I have a Details View that when I fire the Update Item event, it doesn't update the data. The page reloads and the data is set back to the original.

The page reloads and the data is set back to the original. I'm using a Button to fire the Update Item event and then leaves the user a status stating that the event is updated, which does occur so i know the button is firing properly. Thanks David Lozzi " Select Command="SELECT * FROM [tbl Events] WHERE ([ID] = @ID)" Delete Command="DELETE FROM [tbl Events] WHERE [ID] = @ID" Insert Command="INSERT INTO [tbl Events] ([str Title], [str Description], [dt Date], [str Speaker], [str Host], [str Location], [str Address], [str City], [str State], [str Contact Name], [str Contact Title], [str Contact Phone], [str Contact Email], [str Notes], [dt Added], [dt Modified]) VALUES (@str Title, @str Description, @dt Date, @str Speaker, @str Host, @str Location, @str Address, @str City, @str State, @str Contact Name, @str Contact Title, @str Contact Phone, @str Contact Email, @str Notes, , )" Update Command="UPDATE [tbl Events] SET [str Title] = @str Title, [str Description] = @str Description, [dt Date] = @dt Date, [str Speaker] = @str Speaker, [str Host] = @str Host, [str Location] = @str Location, [str Address] = @str Address, [str City] = @str City, [str State] = @str State, [str Contact Name] = @str Contact Name, [str Contact Title] = @str Contact Title, [str Contact Phone] = @str Contact Phone, [str Contact Email] = @str Contact Email, [str Notes] = @str Notes, [dt Modified] = WHERE [ID] = @ID" Protected Sub btn Update_Click(By Val sender As Object, By Val e As System. Here is my detailsview: I tried adding a label to my page and then once updated Name had been assigned the value of the textbox I tried assigning that value to the label and it printed out the old product name not the one in the textbox.I can't see anything wrong with the code and it's driving me mad. hi, i think you miss something, try to see the table where you save the value of the fields you entered if it change anything, if it change anything, then you have put some code on your SP that retrieves data after the UPDATE code that you have. I have looked at thing such as datakeys and making sure the update command is correct but I can't find the problem. Could the item_id (the primary key) being evaluated instead of binded have do with it?" Delete Command="DELETE FROM [items] WHERE [item_id] = @original_item_id AND [item_date] = @original_item_date AND [item_order ID] = @original_item_order ID AND [item_brdft] = @original_item_brdft AND [item_dollars] = @original_item_dollars" Insert Command="INSERT INTO [items] ([item_date], [item_order ID], [item_brdft], [item_dollars]) VALUES (@item_date, @item_order ID, @item_brdft, @item_dollars)" Select Command="SELECT * FROM [items] WHERE ([item_id] = @item_id)" Update Command="UPDATE [items] SET [item_date] = @item_date, [item_order ID] = @item_order ID, [item_brdft] = @item_brdft, [item_dollars] = @item_dollars WHERE [item_id] = @original_item_id AND [item_date] = @original_item_date AND [item_order ID] = @original_item_order ID AND [item_brdft] = @original_item_brdft AND [item_dollars] = @original_item_dollars" Conflict Detection="Compare All Values" Old Values Parameter Format String="original_"I have a Form View that won't update at all.I have looked at thing such as datakeys and making sure the update command is correct but I can't find the problem. Could the item_id (the primary key) being evaluated instead of binded have do with it?