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
the screen appear a circle go round and round and cannot click any place
what happened ?
and after return from GetAsync method, what is the next step to run ?
SIGN IN To post a reply.
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
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
SIGN IN To post a reply.
- 2 Replies
- 2 Participants
-
TE Ted
- Aug 18, 2021 06:34 AM UTC
- Aug 19, 2021 01:22 PM UTC