Datagridcolumn: Binding Visibility and Width via BindingProxy show different behavior

后端 未结 1 609
悲&欢浪女
悲&欢浪女 2021-01-28 18:35

As the columns of a data grid aren\'t in the visual tree of datagrid I\'m m using this approach of Binding Proxy to bind Visibility of a DataGridTextColumn.

<
1条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-28 19:09

    The type of the Width property of a DataGridColumn is DataGridLength and not double.

    Change type of your source property:

    public DataGridLength Width
    {
        get { return m_width; }
        set { m_width = value; OnPropertyChanged("Width"); }
    }
    
    DataGridLength m_width;
    

    And the Mode of the Binding:

    
    

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