WPF DataGrid using ISingleResult<> as ItemsSource does not allow sorting

May 27, 2009 at 10:35 PM

I am using Linq to SQL and using stored procedures. This generates for me a method that returns an ISingleResult as shown below.

  public ISingleResult<spMySPResult> spMySP()
   IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
   return ((ISingleResult<spMySPResult>)(result.ReturnValue));

I can use the above as my ItemsSource and am able to generate the wpf datagrid.
I noticed that I am not able to do any sorting and as a result, no grouping is possible.
If instead I use a List<> and use the table instead of a stored procedure, I am able to sort as well.

Can someone please let me know how to be able to sort if I do use a stored procedure / ISingleResult<> ?


May 30, 2009 at 2:16 PM

Check to see if ISingleResult<> creates a BindingListCollectionView on the DataGrid.  If so then see this thread for further info, http://wpf.codeplex.com/Thread/View.aspx?ThreadId=35129.