Events Exist Check?

L

localhost

I have a DataTable that sometimes has the RowChanged event wired up.

Later in code, how can I determine if the DataTable has had the
RowChanged event added already - I don't want to add it twice.

Thanks.
 
S

Sijin Joseph

You can use Delegate.GetInvocationList() method to get the list of already
attached event handlers. If the count is greater than zero then an event
handler has already been attached.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top