This is a migrated thread and some comments may be shown as answers.

updating column periodically with current timespan = Now - Created

2 Answers 42 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Damian Slee
Top achievements
Rank 1
Damian Slee asked on 30 Mar 2010, 04:21 PM
I have a RadGridView that is displaying a collection of records.  I am binding the collection to the grids ItemSource.  The collection and properties implements INotifyPropertyChanged and ICollectionChanged, and displays the values correctly.

One of the record properties is the time it was created.  I can display this ok, but I would rather display Now - Created timespan in minutes.  And then update it once a minute, to indicate how long the record has been "active" for.

I can use a value converter to calculate the timespan and return the number of minutes, but I am not sure how to trigger it to refresh the value in the cell (or increment it by 1 minute), every minute?

Only idea i have at the moment is creating a DispatcherTimer, and iterating through all the rows, updating each cell.   Is there anyway through binding I can trigger this to happen, or some interactivity behaviour to update it self?

thanks.

2 Answers, 1 is accepted

Sort by
0
Damian Slee
Top achievements
Rank 1
answered on 30 Mar 2010, 04:55 PM
a Rebind() on the grid from a dispatcher timer seems to refresh it with the new elapsed time.   But i am concerned on how the performance will be with lots of records.
0
Vlad
Telerik team
answered on 31 Mar 2010, 07:31 AM
Hello,

Generally Rebind() will work exactly like INotifyCollectionChanged - will refresh the grid records.

Kind regards,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Damian Slee
Top achievements
Rank 1
Answers by
Damian Slee
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or