This question is locked. New answers and comments are not allowed.
The following piece of code...
Produces the following error..
base {System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.ArrangeLowestHeaders()
at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.ArrangeHeaders()
at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.PlaceCommonHeaders()
at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.Rearrangeheaders()
at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.NotifyCellsPropertyChanged(DependencyObject d, String propertyName, DependencyPropertyChangedEventArgs e, UpdateTarget target)
at Telerik.Windows.Controls.GridView.GridViewHeaderRow.NotifyPropertyChanged(DependencyObject d, String propertyName, DependencyPropertyChangedEventArgs e, UpdateTarget target)
at Telerik.Windows.Controls.GridView.GridViewDataControl.NotifyPropertyChanged(DependencyObject d, String propertyName, DependencyPropertyChangedEventArgs e, UpdateTarget target)
at Telerik.Windows.Controls.GridViewColumnCollectionInternal.CalculateColumnWidths(Object arg)} System.Exception {System.NullReferenceException}
Any thoughts as to why?
this
.DataGrid.ColumnGroups.Clear();
var groupColumnDef =
new
GridViewColumnGroup();
groupColumnDef.Header = column.Title;
groupColumnDef.Name = column.Title.GetColumnName();
groupColumnDef.HeaderStyle =
this
.Resources[
"s1"
]
as
Style;
groupColumnDef.HeaderTemplate =
this
.Resources[
"GroupHeader"
]
as
DataTemplate;
// Add the group
// The current column is top level so just add it
if
(!
this
.DataGrid.ColumnGroups.Contains(groupColumnDef))
this
.DataGrid.ColumnGroups.Add(groupColumnDef);
Produces the following error..
base {System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.ArrangeLowestHeaders()
at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.ArrangeHeaders()
at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.PlaceCommonHeaders()
at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.Rearrangeheaders()
at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.NotifyCellsPropertyChanged(DependencyObject d, String propertyName, DependencyPropertyChangedEventArgs e, UpdateTarget target)
at Telerik.Windows.Controls.GridView.GridViewHeaderRow.NotifyPropertyChanged(DependencyObject d, String propertyName, DependencyPropertyChangedEventArgs e, UpdateTarget target)
at Telerik.Windows.Controls.GridView.GridViewDataControl.NotifyPropertyChanged(DependencyObject d, String propertyName, DependencyPropertyChangedEventArgs e, UpdateTarget target)
at Telerik.Windows.Controls.GridViewColumnCollectionInternal.CalculateColumnWidths(Object arg)} System.Exception {System.NullReferenceException}
Any thoughts as to why?