I have a winForms DataGridView
bound to a List<MyObjectType>
. My problem is that once I do the initial myDataGridView.DataSource = myObjectList;
that adding/removing elements from the list is not reflected in the displayed DataGridView even though in the debugger the row count on myDataGridView.DataSource
does update.
I'm able to force the DGV to update the displayed rows if I null the datasource before reassigning the list to it. This looks ugly though and I'm wondering if I didn't miss an easier way to do this.
myDataGridView.DataSource = null;
myDataGridView.DataSource = myObjectList;