After return from GetAsync method in custom adaptor the program freeze

While I use custom adaptor in <SfDataManager> for a <SfGrid>

after return from GetAsync

擷取.JPG

the screen appear a circle go round and round and cannot click any place

20210818-2.PNG

what happened ?

and after return from GetAsync method, what is the next step to run ?


2 Replies

TE Ted August 18, 2021 08:01 AM UTC

sorry, after i upgrade from v.18.xx to v.19.2.0.56 , the problem seems do disappear

but the AllowSorting for <SfGrid>doesn't work

  



RN Rahul Narayanasamy Syncfusion Team August 19, 2021 01:22 PM UTC

HI Ted, 

Greetings from Syncfusion. 

Query: after i upgrade from v.18.xx to v.19.2.0.56 , the problem seems do disappear but the AllowSorting for <SfGrid>doesn't work 

We have validated your query and we suspect that you are facing difficulties in performing sorting operation while using CustomAdaptor. While using CustomAdaptor, you need to handle the dataoperations(sorting, filtering,etc) in CustomAdaptor Read/ReadAsync method. Find the below code snippets, sample and documentation for your reference. 

Reference: 

// Implementing custom adaptor by extending the DataAdaptor class 
   public class CustomAdaptor : DataAdaptor 
    { 
        // Performs data Read operation 
        public override object Read(DataManagerRequest dm, string key = null) 
        { 
            IEnumerable<Order> DataSource = Orders; 
            DataResult DataObject = new DataResult(); 
            if (dm.Search != null && dm.Search.Count > 0) 
            { 
                // Searching 
                DataSource = DataOperations.PerformSearching(DataSource, dm.Search); 
            } 
            if (dm.Sorted != null && dm.Sorted.Count > 0) 
            { 
                // Sorting 
                DataSource = DataOperations.PerformSorting(DataSource, dm.Sorted); 
            } 
            if (dm.Where != null && dm.Where.Count > 0) 
            { 
                // Filtering 
                DataSource = DataOperations.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator); 
            } 
            int count = DataSource.Cast<Order>().Count(); 
            if (dm.Skip != 0) 
            { 
                //Paging 
                DataSource = DataOperations.PerformSkip(DataSource, dm.Skip); 
            } 
            if (dm.Take != 0) 
            { 
                DataSource = DataOperations.PerformTake(DataSource, dm.Take); 
            } 
            . . . 
            return dm.RequiresCounts ? new DataResult() { Result = DataSource, Count = count } : (object)DataSource; 
        } 
    } 


If you are still facing the problem, then could you please share the below details. It will be helpful to validate and provide a better solution. 

  • Full Grid and CustomAdaptor code snippets.
  • Reproduce the problem in the provided sample and revert back to us.
  • Share a simple reproduceable sample if possible.

Regards, 
Rahul 


Loader.
Up arrow icon