Binding the Width Property of a DataGridColumn to the ActualWidth of the parent DataGrid

前端 未结 1 1232
忘掉有多难
忘掉有多难 2021-01-22 08:34

I tried to solve my previous question with manually binding the Width property of the DataGridTextColumn here is the first Version of my XAML Code.

1条回答
  •  不要未来只要你来
    2021-01-22 09:24

    Had the same issue and found out that using x:Reference you cannot refer to any container of the object you are using it from. Nasty hack, but I'd imagine if you created some other control (TextBlock) and bound it's width to the DataGrid ActualWidth and THEN used x:Reference on that TextBlock it would avoid the cyclical reference

    
    
            
                
                
                
            
    
    

    0 讨论(0)
提交回复
热议问题