Reputation: 4305
I am sorting datatable datewise like
TableWithOnlyFixedColumns.DefaultView.Sort = "TradingDate asc";
then assign this datatable to datagridview to display the sorted records like.
datagridView1.DataSource =TableWithOnlyFixedColumns.DefaultView;
But the problem is when datatable is updated means is changed then according to datatable, datagridview also updates its records but I want like when above statement execute again it should update its record. And if I copy the records from the datatable to datagridview cell by cell manually then records in the datagridview is not sorted datewise.
What I can do for this ?
Upvotes: 1
Views: 1564
Reputation: 1062660
A DataGridView
, when given a DataSource
is inherently data-bound. You can suspend notifications (for example, by going via a BindingSource
and setting RaiseListChangedEvents
to false
), but this is just notifications - it is still looking at the same IListSource
/ IList
etc.
To get truly isolated data, either:
Upvotes: 3