views:

360

answers:

1

I have recently uplifted my SL2 solution to SL3. I have a UserControl that contains only a datagrid:

<UserControl x:Class="Case.CaseDataGrid_View"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data">


    <data:DataGrid Language="en-GB"
                   AutoGenerateColumns="True"
                   RowHeight="20"
                   ItemsSource="{Binding Cases}"
                   SelectedItem="{Binding SelectedCase, Mode=TwoWay}">

    </data:DataGrid>

</UserControl>

This is refernced from a parent page:

<UserControl 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"
             x:Class="eg.WorkManager.UI.Module.CaseEnquiry.CaseEnquiry"
             d:DesignWidth="888"
             d:DesignHeight="480"
             xmlns:case="clr-namespace:Case;assembly=UserControls">

    <ContentControl x:Name="SecurityContext"
                    HorizontalContentAlignment="Stretch"
                    VerticalContentAlignment="Stretch">
        <Grid x:Name="LayoutRoot">
            <case:CaseDataGrid_View Grid.Row="0" 
                                    MinHeight="200" 
                                    Margin="8,8,0,8" 
                                    HorizontalAlignment="Left" 
                                    VerticalAlignment="Top" 
                                    Height="Auto" 
                                    Cases="{Binding Cases}" 
                                    SelectedCase="{Binding SelectedCase, Mode=TwoWay}" 
                                    CustomGridFields="{Binding CustomDataGridFields}"  />

</Grid>
    </ContentControl>
</UserControl>

When I add an x:Name property to my base UserControl, all of my attributes on the User control reference start throwing errors:

<data:DataGrid x:Name="AnythingItSeems" 
Language="en-GB"
                       AutoGenerateColumns="True"
                       RowHeight="20"
                       ItemsSource="{Binding Cases}"
                       SelectedItem="{Binding SelectedCase, Mode=TwoWay}">

        </data:DataGrid>

Errors are firstly reported as Unknown attribute Grid.Row, pointing to the XAML in the parent page:

<case:CaseDataGrid_View Grid.Row="0"

When I remove the Grid.Row attribute, the next throw a similar error.

Is this a known issue / bug with the datagrid ? If not, any ideas what is causing this?

Thanks, Mark

A: 

It appears that my SL3 updgrade didn't update my SL assembly references properly (i keep copies of SL assemblies in source code, so developers who aren't working from C:\ as a default can still open the project and compile)

Mark

Mark Cooper
I do the same thing. As you discovered, you do need to update those assemblies manually when you set your source tree up like that.
scottmarlowe
Actually even updating the saved assemblies didn't work, I had to point back to the default location: c:\Program Files\Microsoft SDKs\Silverlight\v3.0\Libraries\Client\ :-(
Mark Cooper