I am trying to write a 2 way binding application using C# winforms I have a BindingNavigator and a DataGridView bound to the same data source
So that I can have 2 way binding ( yes in winforms ) I want to be able to detect when the bindingSource sort order has changed.
When I click the column header of the DataGridView the sort order of the grid does change and the BindingSource.ListChanged event does fire
However the bindingSource.Sort remains null
When the grid column header is clicked the BindingSource.ListChanged event does fire
private void bindingSource_ListChanged(object sender, ListChangedEventArgs e)
{
if (e.ListChangedType == ListChangedType.Reset)
{
if (bindingSource.Sort != null)
{
controller.Sort = bindingSource.Sort; // never gets here. Why?
}
}
}
Why isn't clicking the DataGridView Column header setting the bindingSource.Sort property? What event should I be listening to in order to detect that the bindingSource sort has changed?