DataGridTextColumn.IsReadOnly seems to be faulty

前端 未结 6 2049
遥遥无期
遥遥无期 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条回答
  •  死守一世寂寞
    2020-12-01 14:25

    I found this solution which allows you to bind to data when the DataContext is not inherited: http://www.thomaslevesque.com/2011/03/21/wpf-how-to-bind-to-data-when-the-datacontext-is-not-inherited/

    Add the BindingProxy class Thomas wrote and add this resource to your DataGrid:

    
        
    
    

    Now you can bind to your DataContex via the Data property of the BindingProxy just as you would expect.

    
    

提交回复
热议问题