David Levine wrote:
> Let's try a different approach...you said previously that you subscribed to
> the DataSourceChanged event. Check the invocation list of that event
> immediately to ensure yourself that you did indeed subscribe to it. Now, why
> would you think that at some point later it is not subscribed? Are you sure
> that the conditions that should cause the event to get fired have actually
> occurred?
At the point I'm checking on the subscriber side, here is what I do:
MyDataGrid.DataSource = null;
MyDataGrid.DataSource = myDataTable;
I do that on purpose to make sure the source is not null and ensure
DataSourceChanged() has to fire. Inside of MyDataGrid, I override the
datasource and assign the value coming in to base.datasource. After
that assignment, DataSourceChanged() fires. It all works fine except
for this one condition on the above code. I have a breakpoint inside
of MyDataGrid.DataSourceChanged() method as well. I'll go through the
above code a few times and all works fine. Then I hit a point at which
it doesn't fire my breakpoint inside of DataSourceChanged. Hope that
helps more.
Now, how exactly do I get at InvocationList() for DataSourceChanged?
Where do I check that exactly? Are you saying at some place I break
and check MyDataGrid.InvocationList()? Because if you are, that method
doesn't exist there. It's buried down inside of base, base on the
watch list for my custom datagrid.
Thanks,
Brett
|