L
Lee Gillie
I have bound a grid column to an enumeration data type.
I derive from DataGridTextBoxColumn and override GetColumnValueAtRow and
call a function I wrote to convert the enumeration value to a
descriptive text for display in the grid cell. This works well.
Even though the grid is not editable, and the column is readonly, when
one clicks on the cell I get a type conversion exception. Looking at the
stack I see Edit calls GetText which uses an "EnumConverter" to convert
the descriptive text to an int32, which ultimately tries to parse the
descriptive as an int32, and of course fails.
I see that DataGridTextBoxColumn has a PRIVATE type converter member.
I am seeking any pointers to examples, or samples, or explanations of
how to intercede the conversion of the descriptive back to an enumerated
value for my custom column type. I think I need to implement a type
converter, but I don't see how to tie it in. Or even just to know "it
can't be done" would be helpful.
I derive from DataGridTextBoxColumn and override GetColumnValueAtRow and
call a function I wrote to convert the enumeration value to a
descriptive text for display in the grid cell. This works well.
Even though the grid is not editable, and the column is readonly, when
one clicks on the cell I get a type conversion exception. Looking at the
stack I see Edit calls GetText which uses an "EnumConverter" to convert
the descriptive text to an int32, which ultimately tries to parse the
descriptive as an int32, and of course fails.
I see that DataGridTextBoxColumn has a PRIVATE type converter member.
I am seeking any pointers to examples, or samples, or explanations of
how to intercede the conversion of the descriptive back to an enumerated
value for my custom column type. I think I need to implement a type
converter, but I don't see how to tie it in. Or even just to know "it
can't be done" would be helpful.