Hi,
I am using data virtuialization with the help of VirtualQueryableCollectionView. Everything works allright. Now I change the content of some database items on a button click. How can I refresh the rows of my gridview. The grid only shows the right content of rows that are newly loaded. Some rows (I guess these are rows that are already displayed and still kept in memory) are not actual.
What do I have to do?
Here is a source code example:
Thanks for help in advance
I am using data virtuialization with the help of VirtualQueryableCollectionView. Everything works allright. Now I change the content of some database items on a button click. How can I refresh the rows of my gridview. The grid only shows the right content of rows that are newly loaded. Some rows (I guess these are rows that are already displayed and still kept in memory) are not actual.
What do I have to do?
Here is a source code example:
public
partial
class
MainWindow : Window
{
WomanEntities _container =
new
WomanEntities();
public
MainWindow()
{
InitializeComponent();
VirtualQueryableCollectionView view =
new
VirtualQueryableCollectionView(_container.Women.OrderBy(k => k.ID));
view.LoadSize = 20;
DataContext = view;
}
private
void
button1_Click(
object
sender, RoutedEventArgs e)
{
WomanEntities _container =
new
WomanEntities();
IQueryable<Woman> women = (from k
in
_container.Women
where k.Age == 60
select k);
foreach
(var item
in
women)
item.HairColor =
"white"
;
_container.SaveChanges();
((VirtualQueryableCollectionView)DataContext).Refresh();
}
}