In a Silverlight project I have a view with a list (DataGrid) of cases. The list is paged with DataPager. My source collection is wrapped in an PagedCollectionView.
When an item is created it is added to the list and set as selecteditem in the DataGrid, depending on the list sorting, this could be on another page the the current active in the datapager.
How would you go about moving the datapager to the page of newly added item?
public PagedCollectionView<CaseDTO> Cases { get; set; }
public void CreateCase()
{
var requestDispatcher = container.GetInstance<IAsyncRequestDispatcher>();
requestDispatcher.Add(GetRequest<CreateCaseRequest>());
requestDispatcher.Add(GetRequest<GetCasesRequest>());
requestDispatcher.ProcessRequests(
responses =>
{
selectedCaseId = responses.Get<CreateCaseResponse>().CaseId;
UpdateCases(responses.Get<GetCasesResponse>());
Cases.MoveToPageOf(SelectedCase); // How to implement?
},
ex => { throw new Exception(ex.ToString()); }
);
}
Cases.MoveToPageOf(SelectedCase); // How to implement?