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

[Solved] Runtime exception when setting ItemsSource

6 Answers 152 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.
Inquisitor Jax
Top achievements
Rank 1
Inquisitor Jax asked on 01 Sep 2009, 02:10 PM
An exception occurs when setting the ItemsSource for the RadGridView.
I'm creating GridViewDataColumn's at runtime.

The callstack seems to indicate it has something to do with measuring the GridViewHeaderCell:
>    System.Windows.dll!MS.Internal.XcpImports.CheckHResult(uint hr = 2148468943) + 0x4b bytes    
     System.Windows.dll!MS.Internal.XcpImports.FrameworkElement_MeasureOverride(System.Windows.FrameworkElement element = {Telerik.Windows.Controls.GridView.GridViewHeaderCell}, System.Windows.Size availableSize = {100,Infinity}) + 0x9b bytes    
     System.Windows.dll!System.Windows.FrameworkElement.MeasureOverride(System.Windows.Size availableSize = {100,Infinity}) + 0x42 bytes    
     System.Windows.dll!System.Windows.FrameworkElement.MeasureOverride(System.IntPtr nativeTarget = 275351776, float inWidth = 100.0, float inHeight = Infinity, out float outWidth = 0.0, out float outHeight = 0.0) + 0x13d bytes    
     [Native to Managed Transition]    
     [Managed to Native Transition]    
     System.Windows.dll!MS.Internal.XcpImports.UIElement_Measure(System.Windows.UIElement element = {Telerik.Windows.Controls.GridView.GridViewHeaderCell}, System.Windows.Size availableSize = {100,Infinity}) + 0x68 bytes    
     System.Windows.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize = {100,Infinity}) + 0xc0 bytes    
     Telerik.Windows.Controls.GridView!Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(System.Windows.Size availableSize = {Infinity,Infinity}) + 0x3e2 bytes    
     System.Windows.dll!System.Windows.FrameworkElement.MeasureOverride(System.IntPtr nativeTarget = 273054480, float inWidth = Infinity, float inHeight = Infinity, out float outWidth = 0.0, out float outHeight = 0.0) + 0x13d bytes    
     [Appdomain Transition]    
     [Native to Managed Transition]   


am I maybe missing something in the runtime generation of the columns?

6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 01 Sep 2009, 02:12 PM
Hello,

Can you send us small example where we can reproduce this error?

Kind 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
Inquisitor Jax
Top achievements
Rank 1
answered on 01 Sep 2009, 02:17 PM
It's currently occuring in our enterprise solution, but I'll see if I can't prepare a small example.

The end exception is:
"A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.dll
Additional information: AG_E_PARSER_BAD_TYPE [Line: 77 Position: 295]"

If I don't set the ItemsSource property, the columns generate fine (without any data of course)

0
Inquisitor Jax
Top achievements
Rank 1
answered on 01 Sep 2009, 03:22 PM
reproducing the issue in a small example is proving to be a challenge.

If I set "ShowColumnHeaders" = false, then the exception does not occur, and the data shows fine.
Seems like there's some iffy code in that GridViewCellsPanel.MeasureOverride() method.
0
Inquisitor Jax
Top achievements
Rank 1
answered on 02 Sep 2009, 08:04 AM
0
Vlad
Telerik team
answered on 02 Sep 2009, 08:10 AM
Hi,

We still cannot reproduce this issue - please let us know if you have any more info about how to replicate this.

All the best,
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
Inquisitor Jax
Top achievements
Rank 1
answered on 02 Sep 2009, 08:30 AM
whohoo! found the problem.

It seems I didn't have a reference to Telerik.Windows.Controls.Input
Found this that pointed me in the right direction.

Just some constructive criticism:
1) It's not apparent at compile-time that this dependency is necessary - I would imagine that this type of error will occur quite regularly for people that are evaluating only the GridView.
2) For people only wanting to take advantage of the GridView control, the dependency footprint on your silverlight app is quite heavy (4 dlls = +- 2Meg. Microsoft DataGrid and DevExpress Grid only have a footprint of +- 600k)

Thanks for the feedback & support thus far. Bar the above, evaluation is going well :)
Tags
GridView
Asked by
Inquisitor Jax
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Inquisitor Jax
Top achievements
Rank 1
Share this question
or