troubleshooting Question

XML error not understood

Avatar of GrahamSkan
GrahamSkanFlag for United Kingdom of Great Britain and Northern Ireland asked on
* WPFXMLVisual Basic.NET
5 Comments1 Solution219 ViewsLast Modified:
Trying to jump from decades of classic VB to .Net and WPF, I am working through this Microsoft tutorial: "Walkthrough: My First WPF Desktop Application", which is here:

Nearing the end, I am getting this error, which doesn't appear to fit the actual code.
'The 'Grid' start tag on line 37 position 10 does not match the end tag of 'StackPanel'. Line 63, position 15.' XML is not valid.      

Note: the line numbers in the following code snippet are the same as those in the VS2015 IDE
<Page x:Class="ExpenseReportPage"
	  d:DesignHeight="300" d:DesignWidth="300"
	  Title="ExpenseIt – View Expense">
	<Grid Margin="10,0,10,10">
		<!--Templates to display expense report data-->
			<!-- Reason item template -->
			<DataTemplate x:Key="typeItemTemplate">
				<Label Content="{Binding XPath=@ExpenseType}"/>
			<!-- Amount item template -->
			<DataTemplate x:Key="amountItemTemplate">
				<Label Content="{Binding XPath=@ExpenseAmount}"/>

			<ImageBrush ImageSource="watermark.png" />
			<ColumnDefinition Width="230" />
			<ColumnDefinition />
			<RowDefinition Height="Auto" />
			<RowDefinition />
		<Label Grid.Column="1" Style="{StaticResource headerTextStyle}">
			Expense Report For:
		<Grid Margin="10" Grid.Column="1" Grid.Row="1">
				<ColumnDefinition />
				<ColumnDefinition />
				<RowDefinition Height="Auto" />
				<RowDefinition Height="Auto" />
				<RowDefinition />

			<!-- Name -->
			<StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Orientation="Horizontal">
				<Label Style="{StaticResource labelStyle}">Name:</Label>
				<Label Style="{StaticResource labelStyle}" Content="{Binding XPath=@Name}"></Label>

			<!-- Department -->
			<StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Orientation="Horizontal">
				<Label Style="{StaticResource labelStyle}">Department:</Label>
				<Label Style="{StaticResource labelStyle}" Content="{Binding XPath=@Department}"></Label>

			<Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" VerticalAlignment="Top"   
				<!-- Expense type and Amount table -->
				<DataGrid ItemsSource="{Binding XPath=Expense}" ColumnHeaderStyle="{StaticResource columnHeaderStyle}" AutoGenerateColumns="False" RowHeaderWidth="0" >

						<DataGridTextColumn Header="ExpenseType" Binding="{Binding XPath=@ExpenseType}"  />
						<DataGridTextColumn Header="Amount" Binding="{Binding XPath=@ExpenseAmount}" />


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros