I've a Datagrid which consumes a WCF DataService. Below is the code I am using;
public partial class MainPage : UserControl
{
static ServiceReference1.SampleDbEntities entities = new ServiceReference1.SampleDbEntities(new Uri("http://localhost:1324/WcfDataService1.svc/"));
static DataServiceQuery<ServiceReference1.Book> query = entities.Books.IncludeTotalCount();
static WcfDataServicesDataSourceProvider<ServiceReference1.Book> context = new WcfDataServicesDataSourceProvider<ServiceReference1.Book>(query, entities);
public MainPage()
{
Xceed.Silverlight.DataGrid.Licenser.LicenseKey = "****-A7K1K-****-BBUA";
this.DataContext = context;
InitializeComponent();
}
}
Now I need to the newly added items to the grid without refreshing it. I have seen that I can use "context.NotifyItemsAdded" for this.
How do I fetch newly added items and insert them into the grid? Can I enumerate through the currently loaded items?