Q1 2013: problem with ColumnSortDescriptor

4 posts, 0 answers
  1. Patrick
    Patrick avatar
    502 posts
    Member since:
    Aug 2012

    Posted 27 Feb 2013 Link to this post

    Hello,
    I have a problem with the Q1 2013 version that was not in the previous, Q3 2012 SP1, version.
    In my application, I have a list of rankings in a TabItem (Microsoft, not Telerik). When I double-click on a ranking, the details of the ranking are displayed in a new TabItem. Now, if I close the tab item with the ranking details, I have the following error:

    Error message= Error: Unhandled Error in Silverlight Application
    Code: 4004    
    Category: ManagedRuntimeError       
    Message: System.ArgumentNullException: Column cannot be null
    Parameter name: newColumn
       at Telerik.Windows.Controls.GridView.ColumnSortDescriptor.OnColumnChanged(GridViewColumn oldColumn, GridViewColumn newColumn)
       at Telerik.Windows.Controls.GridView.ColumnSortDescriptor.OnColumnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
       at Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
       at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
       at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
       at System.Windows.Data.BindingExpression.SendDataToTarget()
       at System.Windows.Data.BindingExpression.SourcePropertyChanged(PropertyPathListener sender, PropertyPathChangedEventArgs args)
       at System.Windows.PropertyPathListener.ReconnectPath()
       at System.Windows.PropertyPathListener.RaisePropertyPathStepChanged(PropertyPathStep source)
       at System.Windows.IndexerPathStep.RaisePropertyPathStepChanged(PropertyListener source)
       at System.Windows.IndexerListener.SourcePropertyChanged(Object sender, PropertyChangedEventArgs args)
       at System.Windows.Data.WeakPropertyChangedListener.PropertyChangedCallback(Object sender, PropertyChangedEventArgs args)
       at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
       at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
       at Telerik.Windows.Controls.GridViewColumnCollectionInternal.ClearItems()
       at System.Collections.ObjectModel.Collection`1.Clear()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.TotalColumnRefresh()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)


    I've look at what can cause this error and found that the following XAML code, in the list of rankings, is the cause of the error:
    <tk:GridView.SortDescriptors>
      <tk:ColumnSortDescriptor Column="{Binding Columns[LastChangeDT], ElementName=GridView}" SortDirection="Descending" />
    </tk:GridView.SortDescriptors>

    If I comment out this code or replace it with a normal SortDescriptor, the error is gone.

    I've also found other problems with ColumnSortDescriptor, where the column is not found (even if it exists) and the application crash.
    Perhaps a check for null for the column in your code would avoid many crashes.

    Patrick
  2. Vera
    Admin
    Vera avatar
    268 posts

    Posted 27 Feb 2013 Link to this post

    Hello Patrick,

     
    This issue has already been resolved and the fix is available with our Latest Internal Build. Please download it and give it a try.

    Let us know in case you experience any other problems.

    Greetings,
    Vera
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Patrick
    Patrick avatar
    502 posts
    Member since:
    Aug 2012

    Posted 27 Feb 2013 Link to this post

    Vera,
    after installing the .225 version, I have the following error, using the same scenario:

    Error message= Error: Unhandled Error in Silverlight Application
    Code: 4004    
    Category: ManagedRuntimeError       
    Message: System.ArgumentException: At least one object must implement IComparable.
       at System.Collections.Comparer.Compare(Object a, Object b)
       at System.Collections.Generic.ObjectComparer`1.Compare(T x, T y)
       at System.Linq.EnumerableSorter`2.CompareKeys(Int32 index1, Int32 index2)
       at System.Linq.EnumerableSorter`1.QuickSort(Int32[] map, Int32 left, Int32 right)
       at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
       at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
       at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
       at lambda_method(Closure )
       at System.Linq.EnumerableExecutor`1.Execute()
       at System.Linq.EnumerableExecutor`1.ExecuteBoxed()
       at System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute(Expression expression)
       at Telerik.Windows.Data.QueryableExtensions.Count(IQueryable source)
       at Telerik.Windows.Data.QueryableExtensions.Aggregate(IQueryable source, IEnumerable`1 aggregateFunctions)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.CreateAggregateResults()
       at Telerik.Windows.Controls.GridViewColumnCollectionInternal.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
       at Telerik.Windows.Controls.GridViewColumnCollectionInternal.InsertItem(Int32 index, GridViewColumn item)
       at System.Collections.ObjectModel.Collection`1.Add(T item)
       at Telerik.Windows.Data.CollectionExtensions.AddRange[T](ICollection`1 collection, IEnumerable`1 items)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.TotalColumnRefresh()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)

    That's not really an amelioration.

    Patrick
  4. Vera
    Admin
    Vera avatar
    268 posts

    Posted 27 Feb 2013 Link to this post

    Hello Patrick,

     
    Unfortunately, we were not able to reproduce the exception using the provided details. Will it be possible for you to isolate the problem in a sample project so we can debug it on our side? You can send the project by opening a support ticket.

    Thank you in advance.

    All the best,
    Vera
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top