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

Move Current To an item which is not on page collection

5 Answers 42 Views
DataServiceDataSource
This is a migrated thread and some comments may be shown as answers.
nuritk
Top achievements
Rank 1
nuritk asked on 09 May 2012, 10:04 AM
Hi,
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

Sort by
0
Rossen Hristov
Telerik team
answered on 09 May 2012, 10:07 AM
Hello,

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.

All the best,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
nuritk
Top achievements
Rank 1
answered on 09 May 2012, 10:23 AM
This is quite clear to me, but I am asking about "QueryableDataServiceCollectionView" object, which is a mediator to the service.
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? 
0
Rossen Hristov
Telerik team
answered on 09 May 2012, 11:37 AM
Hello,

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. 

All the best,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
nuritk
Top achievements
Rank 1
answered on 09 May 2012, 11:56 AM
Thanks for the quick reply. 
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.

0
Rossen Hristov
Telerik team
answered on 09 May 2012, 12:13 PM
Hi,

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.

Kind regards,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DataServiceDataSource
Asked by
nuritk
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
nuritk
Top achievements
Rank 1
Share this question
or