Home Forums WPF controls Xceed DataGrid for WPF Problem with refresh when Filter in place.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #23981 |

    After modifying a record I tend to do a refresh on the grid to show the current state. This is because I need to exercise the Filter on the Grid again. However, I notice that I get an exception ONLY the first time through (1st time refresh) of
    “Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index”

    I’ve stepped through the code and the error doesn’t throw in the Filter method but IMMEDIATELY after it returns to the method and the Refresh call. What is odd is that after modify many records subsequent to this the error doesn;t return ?

    Any ideas ?

    Dezzz.

    Imported from legacy forums. Posted by Desmond (had 788 views)

    User (Old forums)
    Member
    Post count: 23064

    Extra Info…

    It only throws an exception on the FIRST time that a result from a Filter method would set a row to be ‘e.Accepted = false;’ – in other words filter out…

    Still ploughing on – would love to hear from any of you who have tried this filter mechanism – though to me its looking like a bug..

    Cheers,

    Dezzz.

    Imported from legacy forums. Posted by Desmond (had 509 views)

    Xceed Support
    Member
    Post count: 5658

    Hi,

    Could you provide the complete exception stack trace for this issue…

    At the same time, we just release version 1.2, would it be possible to confirm if your problem is still present in the latest version (we might have fixed it already!)

    Imported from legacy forums. Posted by Marcus [Xceed] (had 398 views)

    User (Old forums)
    Member
    Post count: 23064

    I’m having a similar problem with exceptions on filtering that occur sporadically. I haven’t determined the pattern yet. I’m using v1.2.

    The same filter that throws this exception subsequently worked without a problem on the same data, in the same session/instance of the application.

    In my case I’m setting Filter directly on the DataGridCollectionView which requires a boolean predicate with a signature like this: private bool FilterItem(object item).

    My code invokes the filtering process like so: DataGridCollectionView.Filter = FilterItem;

    I’m currently at a loss on this problem but wonder if it has something to do with the way filter ops can be deferred.

    Here is a typical stack trace:

    Filtering Started…
    FilterRow_FilterRowChanged: Exception:Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    FilterRow_FilterRowChanged STACK TRACE: at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, Excepti
    onResource resource)
    at System.ThrowHelper.ThrowArgumentOutOfRangeException()
    at Xceed.Wpf.DataGrid.DataGridCollectionViewGroup.GetRawItemAtGlobalSortedIndex(Int32 index)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.GetItemAt(Int32 index)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.AdjustCurrencyAfterReset(RawItem oldCurrentRawItem, Int32 oldCurrentPosition, Boolea
    n itemsChanged)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.ForceRefresh(Boolean sendResetNotification)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.Refresh()
    at Xceed.Wpf.DataGrid.DataGridCollectionView.set_Filter(Predicate`1 value)
    at … (stack trace stops at the orgin point in my code for setting the filter …)

    Imported from legacy forums. Posted by Richard (had 826 views)

    Xceed Support
    Member
    Post count: 5658

    Hi,

    We have recently fixed an issue closely related to the stack trace you sent (in fact, it’s the exact same stack trace )…

    You can expect a fix for this in the next service release.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 431 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks Marcus, That’s great news.

    Any ETA on this service release 🙂 ?

    Imported from legacy forums. Posted by Richard (had 5110 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.