Another question,
we are working with wcf data services and the dataservicedatasource (the mvvm way - QueryableDataServiceCollectionView) with the datapager.
On certain scenarios, after adding a new item for example, we would like to set the current item in the datagrid to an item
which may or may not be on the presented page in the pager.
the MoveCurrentTo() method does not work if it is not on the collection of the page retrieved.
Is there an easy way to do so?
Thanks
5 Answers, 1 is accepted
From RadGridView's point of view the all the data is what is on the current page. It has no clue that other data exists somewhere else, i.e. on other pages.
So the current item can only be something that is currently displayed in the grid -- the rest of the data is on some remote server and is requested via the OData protocol when the pager is changing the pages.
RadGridView does not know anything about it.
I hope this explains it.
Ross
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I figured out it should be able to bring an item into view even if it is not currently presented.
So we have to do a custom "item in page" calculation in the server?
The QDSCV cannot bring such an item into view, since the item is not on the client. It is not here. It does not exist here on the client. The QDSCV does not know what is residing on the server. The item might not even exist the next time an OData request is sent. Someone might have deleted it for example. Or the server can be changing its data every millisecond as a matter of fact -- no one knows what is happening there on the server.
Think about it this way -- a request is made to the server and some data comes back as a result of this request. That is all the data that the collection knows about. It does not know what is going on on the other end in the meantime. Data might be changing every millisecond there. Unless something is brought back to the client -- it does not exist from the client's point of view. It can only work with the entities that are loaded in memory on the client.
I hope this makes sense.
So yes, you would have to devise some algorithm to do this "custom "item in page" calculation in the server" which goes beyond the scope of Telerik support.
Ross
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I still think it is a feature that should be in the scope of QDSCV.
In my opinion just as MoveCurrentTo() returns false if it does not find the item, so does QDSCV should have the possibility
to bring an item int view from server and if it does not exist, returns false.
Thanks again.
I am afraid that the functionality which your are suggesting is neither realistic nor feasible. If you try to implement it yourself (but not only for your particular case in which you know what is happening on your server -- but for every possible OData scenario in the world), you will arrive at the same conclusion.
Thank you for your understanding.
Ross
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>