Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
249
Internal error: owner arg should never be null
posted

Hi,

I have a strange error that I don't understand. Please view the attached text file for error details.

I have a grid with one column of (mostly) checkboxes. Note these ultracheckbox controls were set manually because the column's data in inconsistent (some cells are blank or contain text). Everything is bound to a manually filled ultradatasource. So far everything works fine.

When a checkbox is checked the SubObjectPropChanged event is caught and used to update the data in the model. The model contains logic to update other data it contains (simple example: checking one checkbox also checks all relevant checkboxes in child objects). These updates need to be reflected in the grid again.

First this was done by replacing all rows in the ultradatasource (it cannot be known how much data has changed so everything need to be updated): This worked ok, but we lost the row expansion state (makes sense because the rows were removed and recreated).

Second solution was to leave the rows in place and set all the cell values (overwriting the old values but maintaining everything else in the grid). This kept the expansion state as desired and updated the rows as desired. All seemed well if not for this one error. It is (occasionally) thrown on this line: 

modelCell.SetValue(gridCell.EditorResolved.Value);

I read the editors value and not the cells value because the event seems to be thrown before the cell has been updated; not much of an issue. However at some point (this line is part of a loop) I get this strange error and I don't know why.

Maybe some1 can shed some light on it?

ty,
Teun

P.S. Swallowing the exception would "solve" the issue and the code would work as expected but obviously I don't want to do that.

Parents
  • 69832
    Offline posted

    It lloks like there is a bug on the CheckEditor whereby the Value property getter is not throwing an exception when the editor is in not edit mode, so execution proceeds until the GetDataFilteredDestinationValue throws an exception because the 'owner' parameter is null.

    For your purposes, this bug is not really the cause of the problem because one way or the other you will get an exception. I'm afraid I was not able to follow exactly what you are trying to accomplish here, but the line of code that is calling UltraGridCell.SetValue would have to change, because you cannot access the editor's Value property unless the cell is in edit mode.

Reply Children