Declined
Last Updated: 25 Jan 2016 09:43 by ADMIN
Svetlin
Created on: 26 Jul 2012 07:29
Category: GridView
Type: Bug Report
6
FIX. RadGridView - refreshing the entity context of Entity Framework does not update the control
If you refresh an object set property of entity context, the RadGridView is not updated. 

The sample code below does not work:

this.radGridView1.DataSource = entities.Countries;

int maxId = (from c in entities.Countries
                         orderby c.Id descending
                         select c.Id).First();

            Country country = new Country();
            country.Id = maxId + 1;
            country.Name = Path.GetRandomFileName();
            entities.Countries.AddObject(country);
            entities.SaveChanges(System.Data.Objects.SaveOptions.AcceptAllChangesAfterSave);

            entities.Refresh(System.Data.Objects.RefreshMode.StoreWins, entities.Countries);
1 comment
ADMIN
Ivan Petrov
Posted on: 21 Apr 2015 10:21
RadGridView requires with EntityFramework (EF) 4.1 or above. In version 4.1 of EF, Microsoft added a mechanism to bind a control to the data locally stored on the machine with support for data change notifications.