private void SortClick(object sender, RoutedEventArgs e)
 {
     GridViewColumnHeader column = sender as GridViewColumnHeader;
     String field = column.Tag as String;
     if (_CurSortCol != null)
     {
         AdornerLayer.GetAdornerLayer(_CurSortCol).Remove(_CurAdorner);
         lstAnalysisDetails.Items.SortDescriptions.Clear();
     }
     ListSortDirection newDir = ListSortDirection.Ascending;
     if (_CurSortCol == column && _CurAdorner.Direction == newDir)
         newDir = ListSortDirection.Descending;
     _CurSortCol = column;
     _CurAdorner = new SortAdorner(_CurSortCol, newDir);
     AdornerLayer.GetAdornerLayer(_CurSortCol).Add(_CurAdorner);
     lstAnalysisDetails.Items.SortDescriptions.Add(new SortDescription(field, newDir));
 }