Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cathcing exceptions from datasources

Status
Not open for further replies.

fawkes

Technical User
Joined
Sep 12, 2003
Messages
343
Location
GB
I have a custom object and a collection that implements IBindingList and I use this collection as the datasource for a bindingsource used for a datagridview.

If the value for one property in my custom object isn't correct an exception is thrown but I can't catch it.

I've tried using BindingSourceComplete but if I put a break in the event handler for BindingSourceComplete the event isn't even raised.

I could with a pointer in the right direction here, I'm tempted to change from exceptions to raising events instead which can be handled.
 
Thanks for the interest, I discovered what I was doing wrong.

I've been able to access the object errors by handling the DataError event for the datagridview but for errors thrown by the collection I've changed these to events similar to the DataError event nad handle these seperately.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top