reference error using v1 of datagrid

Dec 3, 2008 at 9:36 PM
I have a resource file I'm reading from the application using the Xamlreader and getting the following error:
+  $exception {"Type reference cannot find public type named 'DataGridColumnHeader'.  "} System.Exception {System.Windows.Markup.XamlParseException}

the resource file has the following:







<Style x:Key="Style149" TargetType="{x:Type toolkit:DataGridColumnHeader}">

<!-- <Style x:Key="Style149" > -->

<Setter Property="toolkit:DataGridColumnHeader.FontSize" Value="12" />

<Setter Property="toolkit:DataGridColumnHeader.FontFamily" Value="Tahoma" />

<Setter Property="toolkit:DataGridColumnHeader.Foreground">


<SolidColorBrush Color="#FFFF0000" />



<Setter Property="toolkit:DataGridColumnHeader.BorderThickness" Value="1" />

<Setter Property="toolkit:DataGridColumnHeader.BorderBrush">


<SolidColorBrush Color="#FFF2F2F2" />



<Setter Property="toolkit:DataGridColumnHeader.Background">


<SolidColorBrush Color="#FFBAC0C8" />







and the code is:


mysr =

new StreamReader("style.xaml");


SkinDict = (




this.Resources = SkinDict;

I'm having similiar problems with the designer. If I create a base blank project the Window1.xaml files works fine when I add the datagrid using the designer.
When I open a XAML file that is not part of the project - read in at runtime I'm getting errors that the controls were not found "the type 'Canvas' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built"








x:Name="CanvasMain" Style="{DynamicResource Style1}" Width="730" Height="436" Background="#FFEBECEA" >


things were working fine with the datgrid before the V1 changes I just replaced




and using the new WpfToolkit.dll

Dec 4, 2008 at 12:57 AM
Edited Dec 4, 2008 at 1:01 AM
In order to use the namespace, the WPFToolkit assembly needs to be loaded so that its assembly attribute that specifies the default XML namespace for its types is loaded as well. Most likely, this hasn't happened when you tried to load the XAML file.

An easy way to load the assembly is to make a reference to it in your project, if you haven't done so already. Then, before you load the XAML, access a type.

Here's a quick and dirty way of doing that:
var t = typeof(Microsoft.Windows.Controls.DataGrid);
if (t != null) // This ensures that the above line isn't optimized away
// Load your XAML
Dec 4, 2008 at 7:15 AM
Thanks that fixed the first problem.

I was looking at the second problem - no tellisense working in the designer and found the MSDN help was missing. I reinstalled MSDN Library for VS 2008 SP1 and now the help is there but intellisense is still not working. Intellisense does work in the code windows

Some more information that may have created the problem
I have VS 2008 SP1 installed with MSDN
I then installed CTP of the toolkit
I then install V1 of the toolkit
I then installed Silverlight 2 for Visual Studio 2008