OT: Telerik RadGridView (Winforms)

OT: Telerik RadGridView (Winforms)

Old forum URL: forums.lhotka.net/forums/t/10020.aspx


SeanD posted on Thursday, February 03, 2011

Hi All,

Just wondering if anyone has any workarounds for the IDataErrorInfo shortfall in the Telerik component. Specifically, I'm binding an EditableRootList to a standard Telerik RadGridView via a standard winform binding source. No fancy heirarchies, or anything.

When I delete a row (in this case customer from Northwind database), I get an expected foreign key constraint exception, as I have orders for that customer.

The .NET grid catches the IDataErrorInfo event, and I can compensate accordingly, however, the telerik grid doesnt catch it, and I drop out to my main application thread exception handler, which puts the form (and grid) in an indeterminate state.

Any assistance, greatly appreciated.

Also, a tidbit for anyone using telerik with ERLB - you have to disable Sorting, otherwise occasionally two rows get added to the grid!!!

Thanks,

Sean.

JonnyBee replied on Thursday, February 03, 2011

Which version of csla are you using?

SortedBindingList was updated on March 5th 2010. The ItemDeleted event was raised with iccorrect ItemIndex which would confuse dataBinding (DataGridView).

Other important fixes was also made in 2009:

* Fix double-event issue when adding item to unsorted SortedBindingList
* Fix issue where CancelNew didn't work properly.

If you are not using Csla 4.1 then I would suggest to update both SortedBindingList.cs and FilteredBindingList.cs in your version of Csla.

I'm also quite sure that your grid is NOT looking at the IDataErrorInfo when a delete fails. IDataErrorInfo is used only for Validation and provide error messages for object/property. If a Delete fails you should get a DataPortalException that obviously is not handled by your code and thus reaches the application thread exception handler.

Are you using a DynamicListBase  list object here for your grid?

Do you handle currency-related exceptions the BindingSource.DataError event?

SeanD replied on Friday, February 04, 2011

Hi Jonny,

I'm using 3.8.1, so fairly up to date, I guess.

We also use the EditableRootListBase for the collection of objects - I'll try the SortedBindingList.

I understand that the IDataErrorInfo interface is used for validation, but in the standard .NET DataGrid, I can catch the DataPortalException in the DataError event handler - just not in the 3rd party one.

Many thanks for the update.

Regards,

Sean

Copyright (c) Marimer LLC