This question is locked. New answers and comments are not allowed.
Zainab Vora
Top achievements
Rank 1
Zainab Vora
asked on 01 Sep 2010, 02:57 PM
Hello,
I am currently trying to clear columns from RadGridView. I am using _grid.Columns.Clear() to do so.
It works fine if the columns count is 0.
However, If the grid contains columns, it crashes with a NullReferenceException. "Object reference not set to an instance of an object."
Is there any other way to clear all the columns?
Currently I am using Version 2010.1.603.1030. Thank you.
I am currently trying to clear columns from RadGridView. I am using _grid.Columns.Clear() to do so.
It works fine if the columns count is 0.
However, If the grid contains columns, it crashes with a NullReferenceException. "Object reference not set to an instance of an object."
Is there any other way to clear all the columns?
Currently I am using Version 2010.1.603.1030. Thank you.
5 Answers, 1 is accepted
0
Zainab Vora
Top achievements
Rank 1
answered on 01 Sep 2010, 03:14 PM
at Telerik.Windows.Controls.GridViewSelectColumn.OnOwnerChanged(GridViewDataControl oldOwner, GridViewDataControl newOwner) at Telerik.Windows.Controls.GridViewColumn.set_DataControl(GridViewDataControl value) at Telerik.Windows.Controls.GridView.GridViewDataControl.UpdateGridViewDataControlReference(IList list, Boolean clear) at Telerik.Windows.Controls.GridViewColumnCollectionInternal.ClearItems() at System.Collections.ObjectModel.Collection`1.Clear() at CpgPortfolioAnalysis.GridView.GridView.UpdateColumns() Above is the Stack trace.
0
Hello Zainab Vora,
Do you modify the ItemsSource of the gridview before clearing the columns?
Can you try with a more recent version (preferable in Silverlight 4)?
Kind regards,
Veselin Vasilev
the Telerik team
Do you modify the ItemsSource of the gridview before clearing the columns?
Can you try with a more recent version (preferable in Silverlight 4)?
Kind regards,
Veselin Vasilev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Zainab Vora
Top achievements
Rank 1
answered on 01 Sep 2010, 04:13 PM
Hello,
Thank you for quick response.
I am not modifying the ItemsSource of the gridview.
We are currently using silverlight 3 and silverlight 4 is not an option.
Is there any another way??
Thanks
0
Hello,
Vlad
the Telerik team
Can you post the exact version of the grid?
Best wishes,Vlad
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Hello,
Vlad
the Telerik team
I've missed the version in your first post. Sorry! Do you have GridViewSelectColumn declared in your case? If this is the case you can download our latest official Silverlight 3 binaries - Q2 2010 SP1.
All the best,Vlad
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
