Now, in version 5.0.0-preview07, it gave an error at first line and I changed it to @viewModel DotVVM.Framework.Controls.IPageableGridViewDataSet<DotVVM.Framework.Controls.IPagingOptions>
However, pagination doesn’t work. It doesn’t give an error either. Empty rows are displayed.
Hi! Thanks for trying out the preview version, your feedback is very valuable to us. We found some bugs when testing this and we’ll probably make some adjustments to make the new datasets less annoying.
However, in your case it’s basically behaving as intended. As Tomas is suggesting, it should work when you use IPageableGridViewDataSet<PagingOptions>, with the specific paging options implementation you want to use. Currently there bugs so it won’t work either
What you can do:
Use CompositeControl instead of markup control. This is the recommended approach essentially every time there is some limitation in markup controls. You’d need to rewrite the control to C# where you explicitly instantiate other controls instead of writing the dothtml markup (note that MarkupControlContainer exists which might allow you to split the control and avoid rewriting too much code)
Copy the binding itself in C# @baseType OnLoad event. Something like this should do it:
Children.OfType<DataPager>().SetBinding(DataPager.DataSourceProperty, this.GetBinding(DataContextProperty))
(or maybe rather pass the dataset in a markup control property than datacontext, it’s less finicky to work with in C#)
I’d definitely recommend 1. if you control is just DataPager wrapper with some custom templates and styles. Other I’d go with the more “hacky” option 2.
We made the datasets more generic in v5 to allow i.e. for token-based paging. It’s now also possible use DataPager and GridView with staticCommands by translating methods like GoToNextPage to JS.
DataPager therefore looks at the binding return type to see which features are supported by the datasets (and potentially which methods to translate to JS if you want staticCommands). It cannot generally do that based on the runtime type (the returned instance), because that will be null in client rendering mode.