What I'm trying to craft is a simple UI that lists the tables (queries) in the data source in a ListBox, and causes the RadGridView/RadGridPager to display (and page through) the data for the table selected in the ListBox.
I had assumed that data binding the QueryName would be the WPF way to do this. What am I missing?
7 Answers, 1 is accepted
I'm starting to think that changing the QueryName is not supported... can anyone confirm?
I'm attaching my sample application that covers your scenario. Could you please take a look at let me know what to do in order to simulate delay issue?
Thank you in advance.
P.S. You will need a running SQLEXPRESS with Northwind sample database installed (otherwise you could change the connection string within web.config).
Nedyalko Nikolov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thanks, your sample causes the correct paged queries to be used. I was starting with the sample from here:
http://www.telerik.com/community/forums/wpf/gridview/hang-crash-with-odata-service.aspx
which has the PageSize set on the RadDataServiceDataSource, and not on the RadDataPager. Sure enough, if I change your sample to do the same, it exhibits the broken behavior.
The delay occurs, I think, as a result of trying to render every row in the table. The Northwind database is not a good test in this case since the database is relatively small (I think the largest table is Orders with about 800 rows). Even with the Northwind database, however, I see a noticable increase in the time taken to render (not retrieve) every Order on the second and subsequent queries.
My actual database has substantially more rows (which is precisely why I want to page through it), and without paging the client is taking several minutes to render after the second and subsequent queries to the same table.
Indeed paging will help with rendering delays, but first of all could you please check if RadGridView is placed in a StackPanel or any other panel which measures the grid with Double.PositiveInfinity. For more info you can take a look at this online help topic.
However we will investigate paging issue and most probably we'll fix it in a couple of weeks (every Monday we have an internal build, so stay tuned).
Nedyalko Nikolov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
But, since I'm setting RadDataPager.PageSize=N, won't that limit the maximum height of the RadGridView to just that height which is enough to show N rows?
Placing RadGridView in a grid panel with row height "*" is OK and indeed RadGridView will generate only several rows (to fulfill the available space), but grid will not be shrinked (if there are not enough items there will be an empty space inside RadGridView).
Kind regards,Nedyalko Nikolov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Can you please try using the underlying collection QueryableDataServiceCollectionView<T> and expose it on your view model. Then each time the user changes the query -- create a new instance of this collection and raise property changed. Bot the grid and the pager should be bound to this collection on the view model.
Kind regards,
Ross
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>