Is there a way (using styles and multi triggers) to always disable the first column of the first row of a DataGrid
in a WPF control? This is a templated column which shows combo box in edit mode and text box in normal mode. I'd like this to never go into the edit mode (only this column). The rest of the columns in the row should be able to go into the edit mode.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Yes, it is possible (in other words you want to disable a definite cell), but I would preferable use
ValueConverter
orCellTemplateSelector
to reach the goal.In the soution below there is a restriction, that you have to set an
AlternationCount
property for theDataGrid
to the number of the elements in ItemsSource.This is a "work around" to get the row index, since
DataGridRow
has no property to get the index(only a methodGetIndex()
).