Completed
Last Updated: 02 Aug 2016 07:47 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 16 Jun 2016 06:52
Category: GridView
Type: Bug Report
0
FIX. RadGridView - TargetException when updating a value in the child template bound to a collection of abstract classes
To reproduce: please refer to the attached sample project.

1. Edit the CommonInt property for the first child row.
2. Edit the CommonInt property for the second child row.

Workaround: Add the grid programmatically at run time.

Second Workaround: 

this.radGridView1.CellValueChanged+=radGridView1_CellValueChanged;

private void radGridView1_CellValueChanged(object sender, GridViewCellEventArgs e)
        {
            e.Column.OwnerTemplate.Refresh(e.Column);
        }
2 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 24 Jun 2016 06:06
Hello John,

Thank you for sharing the workaround. I have added it to the item's description.

Regards
John
Posted on: 23 Jun 2016 20:48
I did find a workaround to this bug:

In the DataGridCellValueChanged event I call:
 e.Column.OwnerTemplate.Refresh(e.Column);

This in turn calls the RebuildColumnAccessors() method which reconstructs the column accessor.  And this prevents the error we were getting in ObjectRelationalAccessor when the cached object was being reused.

Thanks,
~John