locked
The type 'Datatemplate' was not found. RRS feed

  • Question

  • Hi,

    The below code is showing an error: The type 'Datatemplate' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

    Please tell the solution.

    <UserControl x:Class="Test.MainPage" xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d ="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc ="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" d:DesignHeight="643" d:DesignWidth="700" Loaded ="UserControl_Loaded">

    <Grid x:Name="LayoutRoot"Background ="White">

    <sdk:Label Height="28" HorizontalAlignment="Left" Margin="76,25,0,0" Name="label1" VerticalAlignment="Top" Content="Label"Width ="120" />

    <sdk:DataGrid AutoGenerateColumns="False" Height="40" HorizontalAlignment="Left" Margin="44,59,0,0" Name="GrdNew" VerticalAlignment="Top"Width ="250" >

    <sdk:DataGrid.Columns>

    <sdk:DataGridTemplateColumn Header="Id" CanUserResize="True" CanUserSort="True" Width="*"></sdk:DataGridTemplateColumn>

    <sdk:DataGridTemplateColumn.CellTemplate>

    <Datatemplate>

    <TextBlock x:Name="tbId"ScrollViewer.VerticalScrollBarVisibility="Auto">

    <sdk:Label Name="lblId" Content="Id"></sdk:Label>

    </TextBlock>

    </Datatemplate>

    </sdk:DataGridTemplateColumn.CellTemplate>

    <sdk:DataGridTemplateColumn Header="Name" CanUserResize="True" CanUserSort="True" Width="*"></sdk:DataGridTemplateColumn>

    <sdk:DataGridTemplateColumn Header="Address" CanUserResize="True" CanUserSort="True" Width="*"></sdk:DataGridTemplateColumn>

    </sdk:DataGrid.Columns>

    </sdk:DataGrid>

    </Grid>

    </UserControl>

    Thursday, October 13, 2011 6:12 AM

Answers

  • It should be DataTemplate (note the casing)

    Thursday, October 13, 2011 6:18 AM

All replies