We help IT Professionals succeed at work.

silverlight datagrid - WCF Service Data auto refresh

at999
at999 asked
on
1,346 Views
Last Modified: 2013-03-05
i have silverlight page, it has a datagrid. I have created a WCF service  which generates data for that datagrid. In my silverlight page, i call that service as shown below


                MyService.MyServiceClient mysvcclient1;
                mysvcclient1= new  MyService.MyServiceClient();
                mysvcclient1.GetDataGridDataCompleted += new EventHandler<MyService.GetDataGridDataCompletedEventArgs>(CompletedHereGetDataGrid);
                mysvcclient1.GetDataGridDataAsync();
                mysvcclient1.CloseAsync();
            }

now i want to refresh that data every 30 seconds... what is the best way to do that?


thanks....
Comment
Watch Question

Aaron JabamaniTechnical Architect

Commented:
Have a Timer in silverlight and refresh your datagrid.

1. When making call , stop the timer.
2. When the async call comes back , start the timer.

Author

Commented:
can you pl give the code? thanks
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
thanks so much gauthampj, will my GUI be stuck when i start DispatcherTimer ? i mean if i start DispatcherTimer will user be able to click other buttons on my silverlight page? please help,,,, many thanks
CERTIFIED EXPERT

Commented:
since the service call itself is async it shudnt make any diff to the user.

Author

Commented:
thanks a lot

Author

Commented:
i was able to do the way you advised thanks again
Aaron JabamaniTechnical Architect

Commented:
Not even few points for me...idea was mine.

Author

Commented:
oh how did i miss it... i am so sorry apeter,,, next time....
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.