Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>After researching how to do this, I have figured it out. I tried to implement what the others said to try, but could not get it to work in Silverlight 2.0. Thus, I searched StackOverflow and Google for more answers. <a href="http://www.scottlogic.co.uk/blog/wpf/2009/04/binding-a-silverlight-datagrid-to-dynamic-data-via-idictionary/comment-page-1/" rel="nofollow noreferrer">ScottLogic</a> and <a href="http://beta.codeproject.com/KB/silverlight/autofiltering_silverlight.aspx" rel="nofollow noreferrer">CodeProject</a> seemed to be what I was looking for but I couldn't get them to work fully. So with a bit of frustration and playing around with code, I finally arrived on the solution. </p> <p>If the collection that you're using for your DataGrid's ItemsSource is <a href="http://msdn.microsoft.com/en-us/library/ms668604.aspx" rel="nofollow noreferrer">ObservableCollection(Of T)</a>, you can get the ability of sorting for the object, plus you can update the collection dynamically at runtime, causing the grid to refresh with the item you insert. I've created a Google Code project that is GPL for you to checkout and download. Please note that I'm using the Microsoft Silverlight 2.0 DataGrid December 2008 Release for this project. I have linked to this download on the project page as well. (The dll's required are referenced from within a lib folder inside the project).<br> <br/> <br/> <h1> Enjoy! </h1><br/> <a href="http://code.google.com/p/silverlight-datagrid-update-items-save-sort/" rel="nofollow noreferrer">Silverlight 2.0 DataGrid Sort Project on Google Code</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload