This is a migrated thread and some comments may be shown as answers.

Invalid XAML if I use RadGridView in a DataTemplate?

0 Answers 18 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rob Ainscough
Top achievements
Rank 1
Rob Ainscough asked on 11 Nov 2011, 05:30 PM
VS 2010 is generating an error that I have "Invalid XAML" ... I've pin pointed the error directly related to Telerik RadGridView being part of a DataTemplate.

<DataTemplate x:Key="MarketingAnswersDataTemplate">
    <Grid Width="650">
        <telerik:RadGridView ShowGroupPanel="False"
                             RowIndicatorVisibility="Collapsed"
                             Margin="8"
                             DataContext="{Binding Source={StaticResource MarketingAnswersData}}"
                             ItemsSource="{Binding Collection}"
                             AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Answers"
                                            MaxWidth="100"
                                            MinWidth="100"
                                            Width="100"
                                            DataMemberBinding="{Binding MarketingID}"
                                            IsVisible="False" />
                <telerik:GridViewDataColumn Header="Answers"
                                            Width="300"
                                            DataMemberBinding="{Binding MarketingAnswer}" />
                <telerik:GridViewColumn  FooterTextAlignment="Center"
                                         IsResizable="False"
                                         IsGroupable="False"
                                         IsFilterable="False"
                                         MaxWidth="30"
                                         MinWidth="30"
                                         TextAlignment="Center"
                                         Width="30"
                                         Background="Transparent"
                                         HeaderTextAlignment="Center"
                                         IsSortable="False"
                                         IsReorderable="False"
                                         ShowDistinctFilters="False"
                                         CellTemplate="{StaticResource MyAppDeleteMiniButton}" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <Button Content="+"
                HorizontalAlignment="Right"
                Margin="0,11,30,0"
                Width="24"
                FontWeight="Bold"
                VerticalAlignment="Top"
                Canvas.ZIndex="1"
                Padding="0"
                Height="22"
                FontSize="21.333"
                ToolTipService.ToolTip="Add a Discount"
                Cursor="Hand"
                FontFamily="Arial"
                Template="{StaticResource MyAppGreenAddButton}">
            <Button.Background>
                <SolidColorBrush Color="#FF1F3B53"
                                 Opacity="0.715" />
            </Button.Background>
        </Button>
    </Grid>
</DataTemplate>

If I remove the Telerik:RadGridView, this will clear VS 2010 "Invalid XAML" error.  

NOTE: Blend 4 does NOT generate any "Invalid XAML" error, this is ONLY in VS 2010.  Also, my application runs fine with in both VS 2010 and Blend 4.  But because of this error the VS 2010 designer is unable to load and display the XAML.

Is this a know BUG?  Any work around?

Thanks, Rob.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Rob Ainscough
Top achievements
Rank 1
Share this question
or