How to get a WPF DataGrid cell to right align without making the selectable area on a new row tiny?

后端 未结 5 1755
走了就别回头了
走了就别回头了 2021-01-31 13:38

I\'m using a WPF4.0 DataGrid. When double clicking on a cell in a new row everything works fine unless I\'ve added a cell style to that column. For example, I h

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-31 14:23

    Just wanted to add to more examples for future code searches.

    I put this in the top of the xaml file:

    
        
    
    

    And then in the datagrid:

    
    

    This right aligns the text and sorting is still enabled. The textbox fills the cell and in this case is colored using a bool converter.

提交回复
热议问题