RadGridView Asynch Loading

2 posts, 0 answers
  1. Brad
    Brad avatar
    3 posts
    Member since:
    Jun 2016

    Posted 29 Nov 2016 Link to this post

    Hi,

    So when using an application like SQL Server Management Studio I can run a query (let's say select * from customer although my queries are very user driven with a few joins mostly the SQL is generated dynamically) and the results grid will start populating rows extremely quickly until the full set is returned.

    I want to emulate this behavior using a RadGridView (WPF)

    I have tried using a data set it takes to long and you don't get that initial feedback of seeing the first rows start flooding in.

    Next I tried loading the customers from a data reader and putting each row into an ObservableCollection<Customer> it is way faster and allows the objects in .Net to start being populated even before the query has finished but ultimately the UI was unable to keep up with the reader and froze until the full set was populated.

    What would be the best approach to get that fast response of data loading and the user seeing the rows start to appear without locking down the UI Thread of the application?

    A typical result set is around 100k records and I can put it in the grid in about 5 seconds using a dataset im hoping to get similar time while showing the user immediate feedback their query is getting results

  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1218 posts

    Posted 02 Dec 2016 Link to this post

    Hi,

    You can try populating the bound observable collection from a new thread. Then there would be switching to the UI thread to execute UI specific logic for adding an item, but there won't be a continuous "freeze" period.

    Regards,
    Ivan Ivanov
    Telerik by Progress
    Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
Back to Top