views:

1190

answers:

1

Hi!

My application uses the DataGrid of WPF Toolkit. Standard column headers are clickable (when I move over them with the mouse, also some effect appears), but the headers of template columns don't have this behaviour. The sorting event is not fired when I'm clicking on the header and there is also no visual effect.

<Controls:DataGrid Sorting="DataGrid_Sorting">
    <Controls:DataGrid.Columns>
        <Controls:DataGridTextColumn Header="Hello" />
        <Controls:DataGridTemplateColumn Header="World">
            <Controls:DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Button Content="Test" />
                </DataTemplate>
            </Controls:DataGridTemplateColumn.CellTemplate>
        </Controls:DataGridTemplateColumn>
    </Controls:DataGrid.Columns>
</Controls:DataGrid>

How can I achieve sorting (or what information do I need to provide the DataGrid with)?

Best Regards, Oliver Hanappi

+3  A: 

Hi!

I have found the solution on CodePlex: http://wpf.codeplex.com/Thread/View.aspx?ThreadId=63961

Best Regards
Oliver Hanappi

Oliver Hanappi
Posting a small example of the solution here would be helpful as well.
jpierson