'CommandConverter' problem

Topics: Prism v4 - WPF 4
Apr 7, 2011 at 6:15 PM

Hi guys,

I am introducing now Prism to our new project in the company. :)

The project is WPF4.

A normal Button on my View can perfectly connect to the ViewModel however if I have the button inside a Style/Template, I get an error:

<Style x:Key="DatagridColumnHeaderCustomTemplateStyle" TargetType="{x:Type DataGridColumnHeader}">
   <Setter Property="Template">
                    <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
                        <Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown">
                          <Button Width="50" Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}, Path=DataContext.MultiSortCommand}" Command="{Binding MultiSortCommand}" Grid.Row="1" />


'CommandConverter' is unable to convert 'Microsoft.Practices.Prism.Commands.DelegateCommand' to 'System.String'.

Any idea? Its a tough nut :(


Apr 7, 2011 at 8:14 PM
Edited Apr 7, 2011 at 8:14 PM

Hi Houman,

You might find the following thread useful, as a similar problem is dealt with:

command in datagrid not work

I hope you find this helpful.


Miguel Bronzovic