We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SourceProvider asynchronous sources

        public override IList GetSource(string sourceName)
        {
            var list = new List<LookupValue>();

            if (!string.IsNullOrEmpty(countryCode))
            {
                var task = CurrentState.Instance.ServiceClient.ListAllProvinces(countryCode);
                var items = task.GetAwaiter().GetResult();
                list.AddRange(items);
            }
            return list;
        }

I want to call an async method from my GetSource provider...is there a documented approach to achieve this? The above code locks and causes the app to stall.

1 Reply

JN Jayaleshwari N Syncfusion Team January 29, 2019 07:24 AM UTC

Hi Mark, 
 
Thanks for contacting Syncfusion Support. 
 
We have checked the reported query “SourceProvider asynchronous sources” from our side. You can refer the following article to get the source as asynchronously. 
 
 
Please let us know if you would require further assistance. 
 
Regards, 
Jayaleshwari N. 


Loader.
Live Chat Icon For mobile
Up arrow icon