DataGridTextColumn.IsReadOnly seems to be faulty

前端 未结 6 2054
遥遥无期
遥遥无期 2020-12-01 14:03

If I create a binding to the IsReadOnly property of the DataGridTextColumn, it does not actualize. If I set it through markup, it works.



        
6条回答
  •  旧时难觅i
    2020-12-01 14:49

    DataGridColumns are not part of the visual tree, and don't participate in binding like this. The way I get around it is to use DataGridTemplateColumn.

    
        
            
                
            
        
        
            
                
            
        
    
    

    There are other workarounds, which I've found a bit too hackish, but they do work; to wit: http://blogs.msdn.com/b/jaimer/archive/2008/11/22/forwarding-the-datagrid-s-datacontext-to-its-columns.aspx

提交回复
热议问题