
bug or feature with expression columns
bear with me the explanation is long winded but reproducable.
I have a winform datagrid that i needed to be both editable and filterable
on a value from a related table. as i could not use a join I added an
expression column to the table my grid is bound to. the expression looks up
the typeid value (a number) from the parent side of the relationship.
so I have a winform,a datagrid, a datatable and an expression column, I
bind the datagrid to the table via a dataview to filter the grid by
expression value (should work as far as i can tell)
The datagrid is now unable to save to its datasource when adding new records
it appears that when the expression evaluates to null which it can in this
situation the datagrid blows up!
an error dialog appears prompting you to correct a value in the grid, wether
you select yes or no the application hangs for about 15 seconds flickers
from a refresh then hangs the entire application and you cant even close the
form, you either have to "end task" or if you are debugging stop the app.
Even basic edits to the datagrid give weird refresh behaviour until you
remove the offending expression then all is fine. you can even set the
expression to a constant value and it works ok. It appears to be something
to do with the Parent.(relation).field evaluating to null in the expression
that is causing this.
Any ideas how to sort this or better an alternative approach to achieve an
Editable and filterable (on child table) grid ?
Colin