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

Xaml error when inside DataTemplate (.NET Core)

3 Answers 182 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Heiko
Top achievements
Rank 1
Iron
Veteran
Heiko asked on 28 May 2020, 03:23 PM

I have a strange new bug in Visual Studio XAML Editor when I place a RadGridView inside a DataTemplate. It is quite easy to reproduce:

  1. create a new WPF Core 3.1 project
  2. add Telerik.UI.for.Wpf.NetCore 2020.2.513 (as NuGet package)
  3. place the following code inside the Resource-part of the window:
01.<Window.Resources>
02.    <DataTemplate x:Key="testTemplate">
03.        <Grid>
04.            <telerik:RadGridView>
05.                <telerik:RadGridView.Columns>
06.                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Title}"></telerik:GridViewDataColumn>
07.                </telerik:RadGridView.Columns>
08.            </telerik:RadGridView>
09.        </Grid>
10.    </DataTemplate>
11.</Window.Resources>

 

It does not matter that there is no ItemsSource or which field you are binding the GridViewDataColumn to. As soon as I include the property DataMemberBinding="{...}" I get a warning from "Microsoft.CodeAnalysis.Xaml.Diagnostics.Analyzers.XamlDocumentDiagnosticAnalyzer" saying that there is a NullReferenceException. From there on there is no more Intellisense or Autocomplete inside my Xaml Editor.

Could someone at Telerik check if it is just my developer machine or is it a bug that I detected? Visual Studio 2019 is Version 16.6.0.

Thanks in advance!

Regards
Heiko

3 Answers, 1 is accepted

Sort by
0
Heiko
Top achievements
Rank 1
Iron
Veteran
answered on 29 May 2020, 10:23 AM

I have to add that this error has nothing to do with the DataTemplate, sorry. It makes no difference whether the grid is in a DataTemplate or not. The error always occurs when I enter a name in the {Binding ...} section of DataMemberBinding; an empty {Binding} is ok.

Today I found this ,unfortunately in japanese; seems to be a problem with latest VS Update to 16.6.0. But because Telerik and Microsoft are so close friends, maybe Telerik can do some investigative work? ;-)

Regards
Heiko

0
Vladimir Stoyanov
Telerik team
answered on 02 Jun 2020, 10:21 AM

Hello Heiko,

I noticed that there is a reply from Microsoft in the shared thread. It seems that the described behavior was an issue in Visual Studio and a fix has been prepared. You can follow the thread in order to be notified for any updates on their side. 

Regards,
Vladimir Stoyanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Doug
Top achievements
Rank 1
Veteran
answered on 19 Jul 2020, 02:12 PM

Thanks for the tip. I have been having the same frustrating problem. Installed 16.7.0 Preview 4 and can confirm that this was fixed.

Tags
GridView
Asked by
Heiko
Top achievements
Rank 1
Iron
Veteran
Answers by
Heiko
Top achievements
Rank 1
Iron
Veteran
Vladimir Stoyanov
Telerik team
Doug
Top achievements
Rank 1
Veteran
Share this question
or