# AG\_E\_PARSER\_BAD\_TYPE when using Grid

**URL:** <https://www.ruby-forum.com/t/ag-e-parser-bad-type-when-using-grid/134346>\
**Category:** IronRuby\
**Created:** [April 10, 2008, 12:11am UTC](https://www.ruby-forum.com/t/ag-e-parser-bad-type-when-using-grid/134346 "2008-04-10T00:11:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thbar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@thbar](https://www.ruby-forum.com/u/thbar)\
**Post date:** [April 10, 2008, 12:11am UTC](https://www.ruby-forum.com/t/ag-e-parser-bad-type-when-using-grid/134346/1 "2008-04-10T00:11:51Z")

</div>

Hi again,

I get a XamlException with error AG\_E\_PARSER\_BAD\_TYPE whenever I use a  
Grid  
control inside the Xaml (even with an Expression Blend generated Xaml  
file).

Is the Grid control currently supported when working with IronRuby ?

– Thibaut

---

<div class="post-metadata">

**Author:** ![thbar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@thbar](https://www.ruby-forum.com/u/thbar)\
**Post date:** [April 10, 2008, 12:21am UTC](https://www.ruby-forum.com/t/ag-e-parser-bad-type-when-using-grid/134346/2 "2008-04-10T00:21:12Z")

</div>

You need to change the namespace of the xaml file probably.  
Expression blend generates xaml for WPF not Silverlight.

I used the grid control in my digg client… so i guess it works fine 🙂

On Thu, Apr 10, 2008 at 10:11 AM, Thibaut BarrÃ¨re  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![thbar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@thbar](https://www.ruby-forum.com/u/thbar)\
**Post date:** [April 10, 2008, 4:08am UTC](https://www.ruby-forum.com/t/ag-e-parser-bad-type-when-using-grid/134346/3 "2008-04-10T04:08:39Z")

</div>

Hi,

the root element had x:Class set incorrectly to  
x:Class=“GridSample.Page”.

Chaning it to “System.Windows.Controls.Grid” solved the issue.

thanks!

– Thibaut

2008/4/10, Jimmy S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![thbar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@thbar](https://www.ruby-forum.com/u/thbar)\
**Post date:** [April 10, 2008, 1:13am UTC](https://www.ruby-forum.com/t/ag-e-parser-bad-type-when-using-grid/134346/4 "2008-04-10T01:13:15Z")

</div>

Are you using the Blend 2 Preview for Silverlight? If not, grab it from  
[Silverlight.net](http://Silverlight.net).

If you are, then can you send me what your XAML looks like? I suspect  
that the root element of your XAML has x:Class set incorrectly for Ruby.  
If Grid is your root …

app.xaml  
\<Grid x:Class=â€System.Windows.Controls.Gridâ€ …\>

app.rb  
System::Windows::Application.current.load\_root\_visual Grid.new,  
â€œapp.xamlâ€

~js

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ivan Porto  
Carrero  
Sent: Wednesday, April 09, 2008 3:18 PM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] AG\_E\_PARSER\_BAD\_TYPE when using Grid

You need to change the namespace of the xaml file probably.  
Expression blend generates xaml for WPF not Silverlight.

I used the grid control in my digg client… so i guess it works fine 🙂  
On Thu, Apr 10, 2008 at 10:11 AM, Thibaut BarrÃ¨re  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
Hi again,

I get a XamlException with error AG\_E\_PARSER\_BAD\_TYPE whenever I use a  
Grid control inside the Xaml (even with an Expression Blend generated  
Xaml file).

Is the Grid control currently supported when working with IronRuby ?

– Thibaut

* * *

Ironruby-core mailing list  
removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

---

<div class="post-metadata">

**Author:** ![thbar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@thbar](https://www.ruby-forum.com/u/thbar)\
**Post date:** [April 10, 2008, 4:18am UTC](https://www.ruby-forum.com/t/ag-e-parser-bad-type-when-using-grid/134346/5 "2008-04-10T04:18:35Z")

</div>

Great! In general, make sure that the x:Class of your XAML matches the  
type of the first argument you pass into load\_root\_visual.

~js
