开发者

DataSourceView.ExecuteUpdate with GridView

开发者 https://www.devze.com 2022-12-13 07:57 出处:网络
I\'m defining my own DataSourceControl and DataSourceView. The load and display of collection in开发者_StackOverflow社区 the GridView works perfectly, however, when I click Update (after clicking Edi

I'm defining my own DataSourceControl and DataSourceView.

The load and display of collection in开发者_StackOverflow社区 the GridView works perfectly, however, when I click Update (after clicking Edit to Edit a row), the values collection which comes through as the second parameter to ExecuteUpdate in my DataSourceView is populated with the old values as is oldvalues collection.

Anybody experienced similar issues, or is there something I am missing?

Thanks.


In your Page.Load event handler, do you have code similar to the following?

If (!this.IsPostBack) DataBind();

Because this sounds like a databinding issue, where your database data has been re-applied to the grid and so your grid has lost all of the edited data it received from the user's postback. If the grid is being re-databound during the Page.Load event, it would probably produce the behaviour you're describing.

0

精彩评论

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