I am trying to create a grid with rowreordering, but could not run because of "source is null".
Is there a specific collection that I can use for that?
Also, I use DomainDataServiice for ItemsSource.
else if (e.Options.Status == DragStatus.DragComplete)
IList source = gridView.ItemsSource as IList;
foreach (object draggedItem in draggedItems)
2 Answers, 1 is accepted
answered on 11 Mar 2011, 10:47 AM
the reason for that is the fact that DomainDataSourceView does not inplement IList. This means that you cannot change row order since the server will return the items in the same order (since the entities are recognized by their primary key, which is immutable).
What you can do is add new column/property in our data model that represent the item order (e.g. Order) and when items are reordered on the silverlight client only to update these properties values of the dragged/dropped objects and submit changes. After that the "GetYourEntities()" method should return the data ordered by this property.
Let me know if you have any further questions.
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!