ColumnHeader arrows not reflected when sorting a DataGrid in XAML

前端 未结 1 1005
野性不改
野性不改 2021-01-05 04:33

I have a DataGrid with some sorting defined in XAML like so:


    

        
相关标签:
1条回答
  • 2021-01-05 04:49

    The OP doesn't look like to be a regular visitor so until that moment I post his solution as an answer:

    Add the SortDirection to the DataGridTextColumn in the DataGrid. This added the ColumnHeader arrows.

    <DataGridTextColumn Header="Ext Firm #" 
                        Binding="{Binding ExternalOrgNo}" 
                        DisplayIndex="4" 
                        SortDirection="Ascending" 
                        Visibility="Visible" />
    <DataGridTextColumn Header="Ext Branch #" 
                        Binding="{Binding ExternalBranchNumber}" 
                        DisplayIndex="5" 
                        SortDirection="Ascending" 
                        Visibility="Visible" />
    
    0 讨论(0)
提交回复
热议问题