tags:

views:

84

answers:

1

How to disable datagrid cell edit?

+1  A: 

The DataGrid columns (like DataGridTextColumn) have an IsReadOnly property, just set it to "True".

<tk:DataGridTextColumn IsReadOnly="True" Binding="{Binding Path=MyData}" Header="My header" />
John Myczek
A bit simpler than what I suggested! Am I right in thinking the ReadOnly columns weren't in the CTP of the DataGrid control when it came out last year? Seems I need to refresh my knowledge.
Xiaofu
Right, IsReadOnly was not in the early releases of the DataGrid. I forget exactly when it was added.
John Myczek