I have a XamGrid with two columns, Name and Type. Depending on Type, I want to have a different kind of column for Name, thus I'm using a TemplateColumn. In the data template I have a ContentControl with a default ContentTemplate and a DataTrigger that sets the ContentTemplateto a different column style if Type is a specific value. I am setting alll four templates (ItemTemplate, EditorTemplate, AddNewRowItemTemplate, AddNewRowEditorTemplate) of the TemplateColumn to this data template.
Name
Type
TemplateColumn
ContentControl
ContentTemplate
DataTrigger
ItemTemplate
EditorTemplate
AddNewRowItemTemplate
AddNewRowEditorTemplate
ItemTemplate, AddNewRowItemTemplate and AddNewRowEditorTemplate work as intended, however EditorTemplate does not, it just shows the name of the bound data type.
Please see here on SO for example pictures and my code.
Hello B,
I’ve attached a modified sample.
Let me know if I may be of further assistance.
Thanks for the fast reply, it works! Could you maybe explain why the EditorStyle is needed for the EditorTemplate, but for the AddNewRowEditorTemplate it's not?