开发者

gridview and sqldatasource control in asp.net

开发者 https://www.devze.com 2023-03-07 07:17 出处:网络
i have a gridview which is populating from sql datasource defined at designed, i have configured sqldatasource to select, update and delete, i have a title field in my table which is primary key, it w

i have a gridview which is populating from sql datasource defined at designed, i have configured sqldatasource to select, update and delete, i have a title field in my table which is primary key, it was working fine and updating the records too. until i removed the boundfields and placed templatefield and itemtemplate. after that i gets an error saying:

You have specified that your update command compares all values on SqlDataSource 'SqlDataSource1', but the dictionary passed in for oldValues is empty. Pass in a valid dictionary for update or change your mode to OverwriteChanges.

if i make the ConflictDetection = "Overwr开发者_如何学JAVAiteChanges" it works fine but does not update.. the requirement for the itemtemplate is because i want to display footer template for new records and change the default edit and delete button to imagebutton...

How should i make it work using itemtemplate...


you can add the columns you want persisted by adding them to the gridview datakeynames collection.

0

精彩评论

暂无评论...
验证码 换一张
取 消