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

[Solved] Exception Code: 4004 System.Windows.Markup.XamlParseException

3 Answers 242 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.
Jeff Watson
Top achievements
Rank 1
Jeff Watson asked on 03 Dec 2009, 09:22 PM

SERVER SIDE:
Java WebService running on Glassfish
Service returns a List     List<host>

CLIENT SIDE:
.net 3.5 Silverlight Application

PROBLEM:
Data is returned from service and bound to items source of data grid.  Listing and sorting works.  Clicking the filter icon in the column header fails.  Help?  I feel like I'm missing something obvious.

Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.Windows.Markup.XamlParseException: AG_E_PARSER_BAD_TYPE [Line: 0 Position: 0]

public partial class ServiceDetail : UserControl  
    {  
        MonitoringServiceClient _monitoringSvc = new MonitoringServiceClient();  
 
        public ServiceDetail()  
        {  
            InitializeComponent();  
 
            // Events  
            this.Loaded += new RoutedEventHandler(ServiceDetail_Loaded);  
        }  
 
        void ServiceDetail_Loaded(object sender, RoutedEventArgs e)  
        {  
            this._monitoringSvc.GetStatusAsync();  
            this._monitoringSvc.GetStatusCompleted += new EventHandler<GetStatusCompletedEventArgs>(_monitoringSvc_GetStatusCompleted);  
        }  
 
        void _monitoringSvc_GetStatusCompleted(object sender, GetStatusCompletedEventArgs e)  
        {  
            // The monitoring service returns a List of host objects List<host>  
            // This binds and items are listed and sortable by clicking columns, but  
            // clicking the filter icon in the column header throws exception.  
            this.itemsGrid.ItemsSource = e.Result;  
        }  
    } 

<Grid x:Name="LayoutRoot" Background="White">  
        <StackPanel> 
            <grid:RadGridView x:Name="itemsGrid" AutoGenerateColumns="False" IsReadOnly="True" ColumnsWidthMode="Fill" CanUserFreezeColumns="True">  
                <grid:RadGridView.Columns> 
                    <grid:GridViewDataColumn Header="Host" UniqueName="hostName"/>  
                    <grid:GridViewDataColumn Header="Host" UniqueName="hasBeenChecked"/>  
                    <grid:GridViewDataColumn Header="Host" UniqueName="currentState"/>  
                </grid:RadGridView.Columns> 
            </grid:RadGridView> 
        </StackPanel> 
    </Grid> 

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 04 Dec 2009, 10:00 AM
Hi Jeff Watson,

We will need a runnable dummy project that reproduces this error so we can debug it and identify what is causing it. You can create a small sample project in which you bind the grid to a List<host> of dummy data (not from the service) just for the sake of reproducing the exception.

Unfortunately, we have no way to infer what is going on from the AG_E_PARSER_BAD_TYPE message only, since this is the message for almost any exception in Silverlight. That is why we really need a project we can debug, since we would really like to help you.

We are looking forward to hearing from you.

All the best,
Ross
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
Jeff Watson
Top achievements
Rank 1
answered on 04 Dec 2009, 05:20 PM
Thanks Ross,

I submitted a support ticket and referenced this post.  This was the only way I knew to attach a .zip with the solution.

Regards,

Jeff
0
Jeff Watson
Top achievements
Rank 1
answered on 08 Dec 2009, 05:19 PM
Telerik support resolved my issue and provided the latest assemblies which should be referenced in my project.  Having the latest assemblies is important!  LESSON LEARNED: Always double check your assemblies if you encounter an error.  Chances are these guys have already fixed it.
Tags
GridView
Asked by
Jeff Watson
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Jeff Watson
Top achievements
Rank 1
Share this question
or