Hello,
I am creating a master detials silverlight page and am having trouble updating the datagrid after inserting a new record. On the top of the page I have text boxes to enter information, when a user clicks on save I would like the information automatically updated in the database and displayed on the datagrid without refreshing the screen.
I am able to save the information to the db with no problems its just trying to get the datagrid to refresh with the new changes.
Some of my code behind for the SAVE button is below:
ViewModel.UpdateWorkflow(summary, reason, Email);
LoadOperation<Document> lo = _Context.Load<Document>(_Context.GetDocumentsQuery(_DocID), rtRefresh, null);
The code for rtRefresh:
private void rtRefresh(LoadOperation<Document> oLoadOperation)
{
if (oLoadOperation.IsComplete)
{
ViewModel.GetDocuments(_DocID);
}
}
I set the ViewModel in the xaml file as:
<controls:ChildWindow.Resources>
<viewModel:DocumentChildWindowViewModel x:Key="ViewModel" />
</controls:ChildWindow.Resources>
And the ViewModel in the code-behind:
ViewModel = Resources["ViewModel"] as DocumentChildWindowViewModel;
Any help would be appreciated, thank you.