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: https://msdn.microsoft.com/en-gb/library/mt270964.aspx.

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"
	  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	  xmlns:local="clr-namespace:ExpenseIt"
	  mc:Ignorable="d" 
	  d:DesignHeight="300" d:DesignWidth="300"
	  Title="ExpenseIt – View Expense">
	<Grid Margin="10,0,10,10">
		<!--Templates to display expense report data-->
		<Grid.Resources>
			<!-- Reason item template -->
			<DataTemplate x:Key="typeItemTemplate">
				<Label Content="{Binding XPath=@ExpenseType}"/>
			</DataTemplate>
			<!-- Amount item template -->
			<DataTemplate x:Key="amountItemTemplate">
				<Label Content="{Binding XPath=@ExpenseAmount}"/>
			</DataTemplate>
		</Grid.Resources>

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

			<!-- 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>
			</StackPanel>

			<!-- 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>
			</StackPanel>

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

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

				</DataGrid>
			</Grid>
		</Grid>
	</Grid>
</Page>
ASKER CERTIFIED SOLUTION
FaheemAhmadGul

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