Gridview在单击编辑按钮时重新加载数据 [英] Gridview Reloads data when edit button is clicked

查看:118
本文介绍了Gridview在单击编辑按钮时重新加载数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我遇到了一个小问题。我有一个搜索文本框来搜索数据库中的数据,搜索条件正常工作,我使用SQL数据源来执行搜索。我的gridview上还有一个编辑按钮来更新数据,但是在它返回正确的数据行之后我单击更新按钮它会再次使用所有数据重新加载整个gridview。



Hi There,

I have encountered a small issue. I have a search textbox to search for data from the database, the search criteria work correctly and I am using an SQL datasource to perform my search. I also have an edit button on my gridview to update data, however after it brings back the correct row of data and i click the update button it reloads the entire gridview again with all the data.

behind the search button:

SqlDataSource1.SelectCommand = "admsp_GetDnisDetails @DDI = '" & txtDDI.Text & "'"
               SqlDataSource1.DataBind()







如果有人能帮助我,我将不胜感激。



谢谢。




If anyone could help me I would appreciate it.

thanks.

推荐答案

抱歉我错误地发布了上一个答案。



用select命令绑定SqlDataSource,但是这个不会使用搜索值更新GridView。为此,您需要使用包含搜索结果的新更新的SqlDataSource绑定GridView。
Sorry i wrongly posted the previous Answer.

You binding the SqlDataSource with select command, but this will not update the GridView with search values. For that you need to Bind the GridView with new Updated SqlDataSource which contains the search result.


这篇关于Gridview在单击编辑按钮时重新加载数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆