I have a master detail screen using gridviews.
When a new master row is saved, the server creates detail rows, but the detail gridview does not display/retrieve these new rows until a different master row is selected and then the new master row is again selected.
How can I get the detail gridview to retrieve these new rows as soon as the save is done?
Putting detailDataSource.Refresh() after the masterDataSource.SubmitChanges() does not work.
Thanks. (This is in a MVVM system btw).
When a new master row is saved, the server creates detail rows, but the detail gridview does not display/retrieve these new rows until a different master row is selected and then the new master row is again selected.
How can I get the detail gridview to retrieve these new rows as soon as the save is done?
Putting detailDataSource.Refresh() after the masterDataSource.SubmitChanges() does not work.
Thanks. (This is in a MVVM system btw).
6 Answers, 1 is accepted
0
Hello,
You will have to recreate the row in order to have the row details added to it. Would you try invoking a RadGridView.Rebind()?
Regards,
Didie
Telerik
You will have to recreate the row in order to have the row details added to it. Would you try invoking a RadGridView.Rebind()?
Regards,
Didie
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Greg
Top achievements
Rank 1
answered on 08 Jul 2014, 05:43 PM
I am not sure how to force a Rebind in my viewmodel event:
private void RowEditEnded(GridViewRowEditEndedEventArgs args)
{
if (!args.ChangesActuallyMade())
{
return;
}
// Loans is the QueryableDataServiceCollectionView
Loans.SubmitChanges();
}
How do I reference the RadGridView that triggered this event so I can call Rebind after the SubmitChanges?
private void RowEditEnded(GridViewRowEditEndedEventArgs args)
{
if (!args.ChangesActuallyMade())
{
return;
}
// Loans is the QueryableDataServiceCollectionView
Loans.SubmitChanges();
}
How do I reference the RadGridView that triggered this event so I can call Rebind after the SubmitChanges?
0
Hello,
You need a reference of RadGridView to invoke such a reset invoking its Rebind() method.
Another way would be to raise a CollectionChanged notification for the row you create detail rows for. Is it possible for you to remove the entire row and then insert/add it again after you updated it accordingly?
Regards,
Didie
Telerik
You need a reference of RadGridView to invoke such a reset invoking its Rebind() method.
Another way would be to raise a CollectionChanged notification for the row you create detail rows for. Is it possible for you to remove the entire row and then insert/add it again after you updated it accordingly?
Regards,
Didie
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Greg
Top achievements
Rank 1
answered on 10 Jul 2014, 02:06 PM
I am new to MVVM and Telerik, so please excuse these basic questions:
- How do you get a reference to an object in the view from with the viewmodel? (My viewmodel does not have a direct reference to the view).
- How would I raise the CollectionChanged notification as you suggest?
Thanks.
- How do you get a reference to an object in the view from with the viewmodel? (My viewmodel does not have a direct reference to the view).
- How would I raise the CollectionChanged notification as you suggest?
Thanks.
0
Greg
Top achievements
Rank 1
answered on 10 Jul 2014, 04:13 PM
I resolved this problem by resetting the FilterDescriptor used by the child gridviews in the parent gridview's QueryableDataServiceCollectionView's OnSubmittedChanges event.
Even if the resulting filter matches the pre-existing filter, it triggers the refresh I needed.
Even if the resulting filter matches the pre-existing filter, it triggers the refresh I needed.
0
Hi,
Thank you for the update. I am glad to hear you have resolved the issue.
Regards,
Yoan
Telerik
Thank you for the update. I am glad to hear you have resolved the issue.
Regards,
Yoan
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.