locked
No Ref for datagrid RRS feed

  • Question

  • I am trying to add a datagrid to an ExpressionBlend 4.0 existing project and I get the error below.  If I start a new project it works, but from inside my existing project, I get this error. 

    Error 1 The type 'sdk:DataGrid' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. 

    Wednesday, November 17, 2010 6:52 PM

Answers

  • Check that you have added the sdk (below as data) to your XAML namespaces and that you have the required assembly referenced in your project:

    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 



    Thursday, November 18, 2010 1:36 AM

All replies

  • Check that you have added the sdk (below as data) to your XAML namespaces and that you have the required assembly referenced in your project:

    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 



    Thursday, November 18, 2010 1:36 AM
  • Thanks, Once I also changed the "sdk:" to "data" this worked.  I wonder why Blend suddenly started producing the wrong reference?  Up until this week, Blend would add a datagrid to a new control and handle all the references.  It is still adding a reference, just the wrong one.

    Anyway, thanks and much appreciated. 

    This is the reference Blend added to the page when I added a datagrid.

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


     

    Thursday, November 18, 2010 1:11 PM
  • Yes, that's the default Blend will create for you. I tested it myself and it worked fine. It's just another way to define the namespaces so if the clr-namespace method works for you, I wouldn't stress too bad for it. Here is again a code from my working test:

    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    <sdk:DataGrid HorizontalAlignment="Left"...


    Friday, November 19, 2010 12:53 AM