Invalid cross-thread access in silverlight

24 Feb

Now when I receive DataServicesQuery.EndExecute and use this to pupulate a list that is bound to a usercontrol via a view model I get: “System.UnauthorizedAccessException: Invalid cross-thread access”

this error also heppend in silverlight application when you create user control or after fill list<myobj> and pass to griddate or radgridview( Telerick) control.

but here is suggests the following fix:


() =>{
CustomersGrid.ItemsSource = nwContext.EndExecute<Customers>(asResult).ToList();


Also use like………


You can change the code above so that the query executes on the UI thread by using the Deployment.Current.Dispatcher object.


() =>{




Leave a comment

Posted by on February 24, 2012 in Silverlight


Tags: , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: