gridview中的计数器/计时器 [英] Counter/Timer in gridview

查看:106
本文介绍了gridview中的计数器/计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.

我想在gridview中添加一列,以显示自下订单以来每秒经过的时间计数器.
我已经使用AJAx更新面板和计时器控件完成了此操作.
我已经编写了有关计时器控件的Tick事件的代码,但是问题是完全刷新了gridview.
并且如果数据更多,则刷新时间要晚一点,说晚3到4秒

Hello.

I want to add a column in a gridview which shows the counter of time elapsed since the order was placed and changes every second.
I have done that with AJAx Update Panel and Timer control.
I have written code on Tick Event of Timer Control but the problem is complete gridview is getting refreshed.
and if data is more then time is refreshed bit late say 3 to 4 seconds late

推荐答案

问题是完全刷新了gridview
如果您不希望这样做,则必须使用Javascript模式.这将需要一些额外的编码.
我建议您也仅在必须刷新所有行的同时保持完整的gridview刷新.如果您要刷新单个列,则创建一个JS方法,然后遍历该特定列的行.

如果数据更多,则刷新时间稍晚一些,例如延迟3到4秒
3-4秒有点太多.滞后可能是由于渲染.

我建议您每5或10秒刷新一次,而不是每秒刷新一次-从逻辑上和可用性的角度来说,1秒没有太大意义.保持5到10秒也可以解决您的整个网格刷新问题.
the problem is complete gridview is getting refreshed
If you don''t want this then you have to with Javascript mode. It would need a little extra coding.
I would suggest you too keep full gridview refresh only as all the rows must be getting refreshed. If you are looking for a single column refresh then create a JS method and just loop through the rows for that particular column.

if data is more then time is refreshed bit late say 3 to 4 seconds late
3-4 seconds is a little too much. The lag may be because of rendering.

I would suggest you to refresh every 5 or 10 seconds instead of per second - logically and usability wise 1 second does not make much of sense. Keeping 5-10sec would also resolve your full grid refresh issue.


这篇关于gridview中的计数器/计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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