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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to load DetailsView ItemsSource asynchronously?

The SfDataGrid’s DetailsViewExpanding event helps you to load the data or set ItemsSource of a DetailsView dynamically. You can use the DetailsViewSource property in GridDetailsViewExpandingEventArgs to set the itemsource for the DetailsViewDatagrid.

When the Data to be loaded in the DetailsView is downloaded from an external source or being read from a file, you may get a time delay. In such case, the Expanding event can be executed before the I/O processes get completes.

In this case, you can use Async and await to load the data with a time delay and hold the event from executing before the data gets loaded from an external source gets completed.

The await keyword ensures that no operations happen before the asynchronous method execution is completed.

The SfGrid_DetailsViewExpanding method runs synchronously until it reaches its first await expression. After await is reached, it is suspended until the awaited task is complete.



The declaration of GetItems() method adding the DetailsViewItemsSource asynchronously until the items are assigned to the underlying_List.




Sample Links:



Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
2394 07/30/2014 03/14/2016 WinRT SfDataGrid 4.5.1
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon