FlexGrid AfterSort Event?

Posted by: jared.fritsch on 9 November 2017, 2:00 am EST

    • Post Options:
    • Link

    Posted 9 November 2017, 2:00 am EST

    It looks like an AfterSort event exists on some of the other platforms for the FlexGrid control. Does anything like that exist on the Xamarin FlexGrid control? I am trying to remove the row selection when sorting occurs.

    https://www.grapecity.com/en/blogs/maintain-row-selection-on-sorting-c1flexgrid

  • Posted 9 November 2017, 2:11 am EST

    You can use the SortChanged event of the FlexGrid’s CollectionView.

    http://help.grapecity.com/componentone/NetHelp/XamarinEdition/C1.CollectionView~C1.CollectionView.C1CollectionView`1_members.html

    First add the handler:

    ((C1CollectionView<object>)grid.CollectionView).SortChanged += GettingStarted_SortChanged;
    

    Then you’ll need to remove the selection when the event fires:

            private void GettingStarted_SortChanged(object sender, EventArgs e)
            {
                grid.Select(new GridCellRange(-1, -1), false);
            }
    

    The same pattern will hold true for other CollectionView derived behaviors like filtering and grouping.

    Thanks

    Kelley

  • Posted 9 November 2017, 2:22 am EST

    Works great - thank you very much! Good to know I can handle those CollectionView events like that. That will definitely be useful.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels