仅当用户未更新Gridview时,才在更新面板上刷新Gridview [英] Refresh Gridview on an update panel ONLY when user is not updating the Gridview

查看:99
本文介绍了仅当用户未更新Gridview时,才在更新面板上刷新Gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个更新面板。在gridview内部,带有文本框和下拉列表的模板。有一个触发器每10秒刷新一次网格。



如果用户正在编辑任何文本框或下拉列表,目标是避免刷新gridview。我怎样才能做到这一点?我想过使用Javascript每10秒运行一次,检查是否有任何文本框或下拉列表有焦点。如果任何控件具有焦点然后忽略,则刷新gridview。有更好的方法或方法吗?

谢谢,

Martin

解决方案

我认为你需要使用计时器来刷新网格。一旦你开始编辑网格,你需要停止计时器。



检查这个..



https://www.asp.net/ajax/documentation/live/tutorials/IntroToTimerControl.aspx [ ^ ]

I have an update panel. Inside a gridview with templates for text boxes and drop down lists. There is a trigger that refreshes the grid every 10 seconds.

The goal is to avoid refreshing the gridview if the user is editing any of the text boxes or the drop down lists. How can I do this? I thought about using Javascript to run every 10 seconds to check the if any of the textboxes or dropdownlists have focus. If any of the controls have focus then ignore, else refresh the gridview. Is there a better approach or way to do this?
Thank you,
Martin

解决方案

I think you need to use timer to refresh the grid. Once you start editing the grid, you need to stop the timer.

Check this..

https://www.asp.net/ajax/documentation/live/tutorials/IntroToTimerControl.aspx[^]


这篇关于仅当用户未更新Gridview时,才在更新面板上刷新Gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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