Click here to Skip to main content
15,915,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 timer also gets refreshed bit late say 3 to 4 seconds late
Posted
Updated 22-Apr-11 21:28pm
v2

1 solution

Not understanding the term "timer column". Assuming it is a column where data changes every sec right?. Is that column need to get data from the server/database? If not then you can use a javascript to update the value and call that script using the SetInterval method of javascript
 
Share this answer
 
Comments
Albin Abel 8-Apr-11 9:48am    
As I said earlier you can use the SetInterval method with a second interval work for this. You need to have a javascript to access the gridview cells and update the value. Then can call the script from set interval method. When the page loads get the initial value and store in a javascript global variable. Not sure some elegant jQuery methods are there for this.
Albin Abel 8-Apr-11 9:49am    
If you need code you may need to wait or wait for someone else to give you that. Instead you could give a try.
Albin Abel 8-Apr-11 10:09am    
Post your javascript code in your question. You will have more chance of getting the answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900