Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

The problem when setting dataGridView.dataSource from CollectionView

$
0
0

Dear Gurus!

In windows form application I am trying to set DataGridView.DataSource:

dc = new myEntities();
_masterObservableCollection = new ObservableCollection<object>(dc.fires);
masterView = (CollectionView)CollectionViewSource.GetDefaultView(masterObservableCollection);
dataGridView.DataSource = masterView;
 

After that I am see that dataGridVies.DataSource has more than 3000 items. But on the form I see empty DataGridView.

When I use 

dataGridView.DataSource = dc.fires;
all is fine and dataGridView has visible data. What is wrong?


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>