problem with HeadersVisibilityProperty

Aug 4, 2009 at 11:54 AM

Hi,

Im facing issue with HeaderVisibility Property.

Repro:-

Im creating control which extends WPF datagrid.Im changing default values of  wpf datagrid according to our user requirement.Im setting HeaderVisibility to DataGridHeadersVisibility.Column.In XAML file im setting HeadersVisibility = ALL, this value is not reflected back to datagrid.

 

When i checked source codeof Datagrid ,I cud see something like this 

 

   public DataGridHeadersVisibility HeadersVisibility
        {
            get { return (DataGridHeadersVisibility)GetValue(HeadersVisibilityProperty); }
            set { SetValue(HeadersVisibilityProperty, value); }
        }

        /// 
        ///     The DependencyProperty that represents the HeadersVisibility property.
        /// 
        public static readonly DependencyProperty HeadersVisibilityProperty =
            DependencyProperty.Register("HeadersVisibility", typeof(DataGridHeadersVisibility), typeof(DataGrid), new FrameworkPropertyMetadata(DataGridHeadersVisibility.All));

 

 

   public DataGridHeadersVisibility HeadersVisibility
        {
            get { return (DataGridHeadersVisibility)GetValue(HeadersVisibilityProperty); }
            set { SetValue(HeadersVisibilityProperty, value); }
        }
        /// <summary>
        ///     The DependencyProperty that represents the HeadersVisibility property.
        /// </summary>
        public static readonly DependencyProperty HeadersVisibilityProperty =
            DependencyProperty.Register("HeadersVisibility", typeof(DataGridHeadersVisibility), typeof(DataGrid), new FrameworkPropertyMetadata(DataGridHeadersVisibility.All));

 

There is no PropertyChangedCallBack Method applied for DatagridHeaderVisibility property.Are there any reasons for this..

 

With regards,

Mahender