This is a migrated thread and some comments may be shown as answers.

[Solved] Exception setting ItemSource when sorting is defined

3 Answers 113 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bill Jindrich
Top achievements
Rank 1
Bill Jindrich asked on 26 Jan 2010, 12:46 AM
I added default sorting in my RadGridView with the XAML below. The Issue that I have is that if I have radGridView.ItemsSource = Nothing in my code, an Exception thrown - when I remove the below XAML, the exception goes away. How can I clear/reset the ItemSource of the RadGridView AND have default sorting, while avoiding the exception?

...

 

 

<telerikGridView:RadGridView.SortDescriptors>

 

 

 

<data:SortDescriptor Member="Title"

 

 

SortDirection="Ascending" />

 

 

 

</telerikGridView:RadGridView.SortDescriptors>
...

 

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 26 Jan 2010, 12:52 PM
Hi,

I've just tried this using our latest service pack (Q3 SP1) however everything worked fine. You can check the attached application for reference.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Bill Jindrich
Top achievements
Rank 1
answered on 26 Jan 2010, 03:41 PM
Interesting. I see that there's no issue with what you sent.

- How can I check which version of the Rad controls I have? (I'm pretty sure I have the latest) - or does this no matter, since I rebuilt you app & it doesn't crash?

- Should I not need to set the ItemSource to Nothing in my code? (I see that you didn't do that in your sample app - I added this & it still didn't crash like mine)
0
Tsvyatko
Telerik team
answered on 27 Jan 2010, 09:17 AM
Hi Bill Jindrich,

You can check your assemblies version by selecting one of the Telerik assemblies in references section. Then in the property window you can check version field.

- Should I not need to set the ItemSource to Nothing in my code? (I see that you didn't do that in your sample app - I added this & it still didn't crash like mine)

You can change the ItemsSource without setting it to null first. Most likely the issue you are facing is due to old version of the assemblies or some additional code you are using that is causing the exception.

I hope this helps.

Best wishes,
Tsvyatko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Bill Jindrich
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Bill Jindrich
Top achievements
Rank 1
Tsvyatko
Telerik team
Share this question
or