I am working on project where I need to put different controls into one column.
So for example we have 3 columns: 1st DataGridCheckBoxColumn 2nd DataGridTextColumn 3rd XXX (DataGridTemplateColumn)
we have some rows filled with data, but for corresponding row in last column - XXX, I need to place different controls like combobox, textbox, datetimepicker depending on underlying data.
Example: [ ] | Text | {Combo Box Control} [X] | Text | {Text Box Control} [X] | Text | {Combo Box Control}
Could You please tell me how it can be done ? Is it possible to achieve that ?
Can it be done by puting ContentControl in DataGridTemplateColumn.CellTemplate> and binding its ContentTemplate property to Converter ?>
Example:
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ContentControl Content="{Binding}" ContentTemplate="{Binding Converter {StaticResource TemplateSelector}}"/>
</DataTemplate>>
</DataGridTemplateColumn.CellTemplate>
Best regards kkris1983