You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So what happens is this chain: TextCell.Value is changed --> TreeDataGridTextCell.Value is changed which sets TextCell.Text which tries to convert the text back to the enum. And which is unnecessary because the TextCell.Value is already correct.
Not sure what the clean solution is, but I guess it might work to change the TextCell.Text setter to:
set
{
if (value != _value?.ToString())
Value = (T?)Convert.ChangeType(value, typeof(T));
}
Setup:
TreeDataGrid with a column that contains an enum.
Action:
The model raises a PropertyChanged event for the enum.
Expected behavior:
The TreeDataGrid updates the cell to the new enum value.
Observed behavior:
A System.InvalidCastException is triggered.
Workaround tried:
I used an IValueConverter for the conversion between the enum and strings. Did not change anything.
Apparently the way the data is displayed normally and the way the data is updated are different.
Example for this issue: https://github.com/blackmole/AvaloniaComboBoxEnum
The text was updated successfully, but these errors were encountered: