Keep Display, Filtering & Sorting same after DataSource Changes

Posted by: sanjeeb.srjm on 6 July 2021, 3:12 am EST

    • Post Options:
    • Link

    Posted 6 July 2021, 3:12 am EST

    Dear Sir/Mam,

    Please advise how to Keep Display, Filtering & Sorting same even after DataSource Changes ?

    Single Use Case:

    1. User starts filtering, sorting and reaches to mid level of display suppose on column-20 and rowno=500…

    2. and now user manupulate a single cell data suppose from 2=>6

    3. now whenever as we as a developer changes it’s source it refreshes which causes all filterings, sortings and display position cleared.

    please advise the solution…

    Regards-

    Sanjeeb

  • Posted 7 July 2021, 12:47 am EST

    Hi Sanjeeb,

    To persist the filter, sort, and scroll state. You can use the FilterDefinition, SortDefinition, and ScrollPosition property as follows:

    //save filter/sorting/display state
                Point scroll = c1FlexGrid1.ScrollPosition;
                string filter = c1FlexGrid1.FilterDefinition;
                string sort = c1FlexGrid1.SortDefinition;
    
                //re-set Data Source here
    
                //reapply states
                c1FlexGrid1.SortDefinition = sort;
                c1FlexGrid1.FilterDefinition = filter;
                c1FlexGrid1.ScrollPosition = scroll;
    

    If you were referring to any other control, then please let us know.

    Regards

    Avnish

Need extra support?

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

Learn More

Forum Channels