Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
XamGrid StackOverflowException when sorting
posted

Hello,

I'm having an issue when sorting a grid for which the backing collection is an ObservableCollection

I'm attaching a simplified sample to illustrate the problem.

After adding one or more items to the grids, you can sort the bottom one without issues, but the application will crash if you try to sort the one at the top.

If you comment out the line where the newly added item is selected, the issue disappears and the grid can be sorted.

Also note that when the very first item is added, it does not get actually selected in the top grid. Subsequent items do get selected.

Thanks,

Rodrigo

XamGridSelectionIssue.zip
Parents
No Data
Reply
  • 105
    Offline posted

    Hello

    Similar problem here with sorting in XamGrid.

    When I add items to a XamGrid before the grid has been rendered. Then sorting leads to a StackOverflowException (second time).

    When I force rendering using this statement
    await Task.Run(() => { });

    then no Exception occurs.

Children