且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我们如何使用boundfield使用datakeys更新gridview

更新时间:2023-10-05 09:14:28

如果你没有 DataKey ,然后你需要将密钥存储在Row内某处的 HiddenField BoundField 或其他什么。



然后在 GridView.RowUpdating事件 [ ^ ],找到该字段并检索该值。之后使用 Id 对您的数据库运行查询。
If you don't have DataKey, then you need to store the Key somewhere inside the Row either in a HiddenField or BoundField or something.

Then inside GridView.RowUpdating Event[^], find that field and retrieve the value. After that run a Query on your Database using that Key or Id.