MaterialDesignInXAML / MaterialDesignInXamlToolkit

Google's Material Design in XAML & WPF, for C# & VB.Net.
http://materialdesigninxaml.net
MIT License
15.17k stars 3.43k forks source link

Unexpected behavior in MaterialDataGridComboBoxColumn when setting ItemTemplate #373

Closed redcurry closed 3 years ago

redcurry commented 8 years ago

I would like the ComboBox in MaterialDataGridComboBoxColumn to have a custom template for each item that appears in the selection box. With a ComboBox, I can just set the ItemTemplate to a DataTemplate. With MaterialDataGridComboBoxColumn, I don't have direct access to the ComboBox, but I have access to the ComboBox's style through MaterialDataGridComboBoxColumn.ElementStyle. I used a Setter to change the ItemTemplate of the ComboBox to my custom DataTemplate. However, the template is applied not to each item in the selection box but to the "text" part of the ComboBox.

I'm not entirely sure if this is a MaterialDesign issue or a WPF issue, so I apologize in advance if this is the wrong place to post this.

Keboo commented 3 years ago

I believe this appropriate thing to do here would be to use the generic DataGridTemplateColumn to achieve the result you want since it will have access to the ComboBox.