9 Answers, 1 is accepted
0
Hello Gertjan,
You can use DispatcherTimer to achieve your goal.
Best wishes,
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.
You can use DispatcherTimer to achieve your goal.
Best wishes,
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.
0
Grtjn
Top achievements
Rank 1
answered on 12 Mar 2010, 09:00 AM
Ok.
So I have been searching how to use the dispatchertimer and found some code
http://www.telerik.com/community/forums/wpf/gridview/gridview-master-detail-representation-with-card-view-detail.aspx (bottom post by Milan)
My connection with the database is not via Linq2SQL, but webservice. Is there a refresh methode for webservices also?
Edit:
Should I refresh my grid, so that my page refreshes while running?
And I am using a Grid, not the RadGridView...
Kind regards,
Gertjan
So I have been searching how to use the dispatchertimer and found some code
http://www.telerik.com/community/forums/wpf/gridview/gridview-master-detail-representation-with-card-view-detail.aspx (bottom post by Milan)
My connection with the database is not via Linq2SQL, but webservice. Is there a refresh methode for webservices also?
Edit:
Should I refresh my grid, so that my page refreshes while running?
And I am using a Grid, not the RadGridView...
Kind regards,
Gertjan
0
Hello GJ DM,
There isn't refresh method that is available for web services. You have to do manually, just on the DipsatcherTimer.Tick handler call your service asynchronously and in the Completed method refresh the grid with the data from the service.
Hope this helps you.
Regards,
Miro Miroslavov
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.
There isn't refresh method that is available for web services. You have to do manually, just on the DipsatcherTimer.Tick handler call your service asynchronously and in the Completed method refresh the grid with the data from the service.
Hope this helps you.
Regards,
Miro Miroslavov
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.
0
Grtjn
Top achievements
Rank 1
answered on 16 Mar 2010, 08:31 AM
Hi,
Thanks for the reply.
But I am not that familiar with the things you said.
Is there any samplecode available that can help me out ?!
Kind Regards,
Gertjan
Thanks for the reply.
But I am not that familiar with the things you said.
Is there any samplecode available that can help me out ?!
Kind Regards,
Gertjan
0
Grtjn
Top achievements
Rank 1
answered on 19 Mar 2010, 02:07 PM
Can you please explain some more Miro or Vlad.
Because I do need some more help to get this right.
Kind Regards,
Gertjan
Because I do need some more help to get this right.
Kind Regards,
Gertjan
0
Hi GJ DM,
You can simply get the whole data from the web service on every DispatcherTimer tick.
public
MainPage()
{
InitializeComponent();
DispatcherTimer timer =
new
DispatcherTimer();
timer.Interval = TimeSpan.FromMinutes(1);
timer.Tick +=
new
EventHandler(timer_Tick);
timer.Start();
}
void
timer_Tick(
object
sender, EventArgs e)
{
// get the whole data
var updatedData =
this
.myService.GetData();
this
.myGrid.ItemsSource = updatedData;
}
All the best,
Milan
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.
0
Grtjn
Top achievements
Rank 1
answered on 23 Mar 2010, 09:25 AM
Hi,
Sorry for the late reply. First of all thanks for sharing this code, but it doesn't seem to work for my...
I get two errors. One on my webservice and one on the itemsSource of my grid.
Error 1 'Pie_Rad_Trend.MainPage' does not contain a definition for 'WebService' and no extension method 'WebService' accepting a first argument of type 'Pie_Rad_Trend.MainPage' could be found (are you missing a using directive or an assembly reference?) C:\Users\gertjan.demeyer\Documents\Visual Studio 2008\Projects\Pie_Rad_Trend\Pie_Rad_Trend\MainPage.xaml.cs 59 36 Pie_Rad_Trend
Error 2 'System.Windows.Controls.Grid' does not contain a definition for 'ItemsSource' and no extension method 'ItemsSource' accepting a first argument of type 'System.Windows.Controls.Grid' could be found (are you missing a using directive or an assembly reference?) C:\Users\gertjan.demeyer\Documents\Visual Studio 2008\Projects\Pie_Rad_Trend\Pie_Rad_Trend\MainPage.xaml.cs 60 29 Pie_Rad_Trend
Any help?
Also i have the 2009-Q3 version..
Kind regards,
Gertjan
Sorry for the late reply. First of all thanks for sharing this code, but it doesn't seem to work for my...
I get two errors. One on my webservice and one on the itemsSource of my grid.
DispatcherTimer timer = new DispatcherTimer(); |
timer.Interval = TimeSpan.FromSeconds(30); |
timer.Tick += new EventHandler(timer_Tick); |
timer.Start(); |
} |
void timer_Tick(object sender, EventArgs e) |
{ |
var updatedData = this.WebService.GetData(); |
this.LayoutRoot.ItemsSource = updatedData; |
} |
Error 2 'System.Windows.Controls.Grid' does not contain a definition for 'ItemsSource' and no extension method 'ItemsSource' accepting a first argument of type 'System.Windows.Controls.Grid' could be found (are you missing a using directive or an assembly reference?) C:\Users\gertjan.demeyer\Documents\Visual Studio 2008\Projects\Pie_Rad_Trend\Pie_Rad_Trend\MainPage.xaml.cs 60 29 Pie_Rad_Trend
Any help?
Also i have the 2009-Q3 version..
Kind regards,
Gertjan
0
Grtjn
Top achievements
Rank 1
answered on 25 Mar 2010, 10:17 AM
You have any idea why this error appears Milan?
Gertjan
Gertjan
0
Grtjn
Top achievements
Rank 1
answered on 29 Mar 2010, 10:31 AM
Plz does anyone know the solution for this?
I really need this timer in order to get my project to work correctly!
Kind regards,
Gertjan
I really need this timer in order to get my project to work correctly!
Kind regards,
Gertjan