D
dirk.bonne
Hi,
I have created my own CustomBindingListView by deriving from
IBindingListView.
Binding a DataGridView to this CustomBindingListView works fine, and
when updates arrive on the underlying data, the DataGridView gets
updated correctly (both changes and additions/removals to the
underlying records set can be seen in the grid).
Except in one case: When I bind to this CustomBindingListView when
there are no items yet in the view.
Then when at a later stage the view gets populated, the grid shows only
empty cells. It seems to recognize that the records are there, and it
shows the rows, except the cells themselves are empty.
When debugging I can see that the rows are requested from the
CustomBindingListView, but that the properties of the items themselves
are never accessed in this case.
I now use a rather painful workaround, that I defer binding until the
binding source get populated, but this is rather a painful business
(register the ListChanged event, watching the CustomBindingListView
instance and check in the handler if the list is non empty. If so, bind
and and unregister the event).
Help! ;-)
Dirk
I have created my own CustomBindingListView by deriving from
IBindingListView.
Binding a DataGridView to this CustomBindingListView works fine, and
when updates arrive on the underlying data, the DataGridView gets
updated correctly (both changes and additions/removals to the
underlying records set can be seen in the grid).
Except in one case: When I bind to this CustomBindingListView when
there are no items yet in the view.
Then when at a later stage the view gets populated, the grid shows only
empty cells. It seems to recognize that the records are there, and it
shows the rows, except the cells themselves are empty.
When debugging I can see that the rows are requested from the
CustomBindingListView, but that the properties of the items themselves
are never accessed in this case.
I now use a rather painful workaround, that I defer binding until the
binding source get populated, but this is rather a painful business
(register the ListChanged event, watching the CustomBindingListView
instance and check in the handler if the list is non empty. If so, bind
and and unregister the event).
Help! ;-)
Dirk