title: Unable to perform Up-down operation when wpf datagrid is sorted
body: <p>HI, </p>
  
  <p>I have a datagrid (from wpf toolkit) which is binded to an observable collection . There are two buttons "Up" and "Down" which moves the selected row accordingly. 
  For eg: If there are 10 items in the datagrid and if I select the 4th item and press "Up" arrow ,then the 4th item will be moved to 3rd item and previous 3rd item will be 4th item. ie swapping with previous item. Similarly "Down" arrow the other way. </p>
  
  <p>private void BtnUpArrowClick(object sender, RoutedEventArgs e)
   {</p>
  
  <pre><code>  try
    {
      btnDownArrow.IsEnabled = true;
      currentRow = grdSeqData.SelectedIndex;
      if (currentRow == 0)
      {
        btnUpArrow.IsEnabled = false;
      }
      else
      {
        upRow = currentRow - 1;
        if (upRow &gt;= 0)
        {
          sequenceDataList.Move(currentRow, upRow);
          currentRow = upRow;
        }
        else
        {
          btnUpArrow.IsEnabled = false;
        }
      }
    }
    catch (Exception ex)
    {
      CatchExeption(LanguageHandler.GetCurrentCultureText("EventUpArrow_Exception"), ex);
    }
  }
  </code></pre>
  
  <p>The above code work fine when the datagrid is not sorted. When i sort the datagrid via header click, and then do the "Up" or "Down" operation nothing is reflected in the datagrid. </p>
  
  <p>The view is getting sorted where as my binded collection remains the same.  So i tried to move the collection from view but in vain.</p>
  
  <p>ICollectionView view = CollectionViewSource.GetDefaultView(grdSeqData.ItemsSource) as ListCollectionView;
  view.MoveCurrentToNext();</p>
  
  <p>I think when the datagrid sortdescription is applied, then the view will not move accordingly. Please help.</p>