I am currently having 2 issues with the RadGridView
I am receiving calls from a WCF Service in the client that do the usual CRUD actions. Of course this comes in on a different thread than the UI thread. So I have a dispatchable observable collection with the code below.
public class DispatchableObservableCollection<T>
public DispatchableObservableCollection(IEnumerable<T> collection)
// Override the event so this class can access it
public override event NotifyCollectionChangedEventHandler CollectionChanged;
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
// Be nice - use BlockReentrancy like MSDN said
NotifyCollectionChangedEventHandler eventHandler = CollectionChanged;
if (eventHandler != null)
Delegate delegates = eventHandler.GetInvocationList();
// Walk thru invocation list
foreach (NotifyCollectionChangedEventHandler handler in delegates)
DispatcherObject dispatcherObject = handler.Target as DispatcherObject;
// If the subscriber is a DispatcherObject and different thread
if (dispatcherObject != null
// Invoke handler in the target dispatcher's thread
else // Execute handler as is
The problem is the object subscribed to NotifyCollectionChanged event for the grid is WeakEvent.WeakListener and the cast to DispatcherObject fails (null). How do I get the DispatcherObject from handler.Target. I'm trying to make this work so that I don't have to use Application.Current.Dispatcher as a bail out so that it will work for UI objects not on the primary UI thread. Is there a work around?
I have detected some odd behavior for add new item. If I have a grid and remove all items and then want to add more back into the grid it works fine. However, if I remove all items from the collection and then close the application and restart when I click the add new item header nothing happens. i.e., a new row is not added. The collection I am using is the one above and the collection is there (Not null), it is just empty. Thoughts?
Thanks for the help,