This is a migrated thread and some comments may be shown as answers.

RadGridView Asynch Loading

1 Answer 114 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 29 Nov 2016, 10:58 AM

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

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 02 Dec 2016, 10:55 AM
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.
Tags
GridView
Asked by
Brad
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or