3

I have a WPF app with a DataGrid bound to a property in my ViewModel. The first column in the DG has a Combobox. When I click on the last row to add a new record and I select a item from the combobox, a red exclaimation sign appears in the record marker at the left and I can't edit the rest of the columns in that new row.

What would cause this to happen?

Jerry
  • 6,357
  • 8
  • 35
  • 50
  • It means there was a validation error of some sort. Do you have any custom validations? – Mark Hall Dec 16 '11 at 23:46
  • 1
    No, I don't have any validations yet. How can I see what the error is? – Jerry Dec 17 '11 at 02:25
  • Check to make sure that the datatype that is being loaded matches the datatype of the Cell. If you are using the [`DataGridComboBoxColumn`](http://msdn.microsoft.com/en-us/library/system.windows.controls.datagridcomboboxcolumn.aspx), I beleive you have to return an [Enum](http://msdn.microsoft.com/en-us/library/system.enum.aspx). Try putting a breakpoint on your CurrentCellChanged Event to see what the data is. – Mark Hall Dec 17 '11 at 04:34
  • In case anyone else finds this - here's a useful related question https://stackoverflow.com/questions/5099039/wpf-datagrid-validation-errors-not-clearing – Robin Bennett Dec 19 '18 at 14:01

0 Answers0