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

radGridView Itemsource issue in design mode

14 Answers 399 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gaurav
Top achievements
Rank 1
Gaurav asked on 31 Jan 2013, 09:07 PM
Hi,
I have derived a custom class from the RadGridView to expose some dependency properties, and in the XAML when I create a control and binding its ItemSource to my viewmodel, then in the design view I'm getting the below error, and due to which the design view is not appearing, can you please help me:

Error 119 The local property "ItemsSource" can only be applied to types that are derived from "DataControl".

Thanks.

Gaurav Gupta

14 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 01 Feb 2013, 07:43 AM
Hi,

 Can you verify that you have all needed references in your project? Do you have Telerik.Windows.Data.dll? System.Windows.Data?

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Gaurav
Top achievements
Rank 1
answered on 01 Feb 2013, 09:33 AM
I have added the Telerik.Windows.Data.dll in the reference, but I'm not able to find the

system.windows.data.dll anywhere, do you mean to say the PresentationFramework.dll as it contains the system.windows.data namespace. Even after adding the PresentationFramework.dll & Telerik.Windows.Data.dll in my project reference, still I'm facing the same issue.

0
Vlad
Telerik team
answered on 01 Feb 2013, 09:40 AM
Hello,

 Please open support ticket and send us the project where we can reproduce this issue. 

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Eric
Top achievements
Rank 1
answered on 25 Mar 2013, 11:58 PM
Was this ever fixed?  It happens in the vs2012 designer quite often.  I am able to resolve the error temporarily by cleaning and rebuilding or by manually ending the XDesProc process to kill the xaml ui designer.  Unfortunately the error returns with almost every change.
0
Maya
Telerik team
answered on 27 Mar 2013, 07:50 AM
Hello Eric,

I tried to reproduce the error in design time, but without any success. Could you take a look at the sample attached ? Is there anything specific that I need to do in order to get the same behavior ?  

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Eric
Top achievements
Rank 1
answered on 01 Apr 2013, 02:25 PM
Maya -

Thanks for taking the time to put together an example for me.  I was not able to reproduce the error consistently in your project and it only happened when I would kill the designer process, which I'm sure is not a good thing to do anyway.  Unfortunately, it must be something in my project (which is a bit more complex than this example) but regardless, I feel better knowing that telerik is not the problem.  I have started a new wpf project from scratch and so far the radgridview works perfect in the designer.  If I am able to isolate whatever was causing the issue I will post back here in case it may help anyone else.
0
Maya
Telerik team
answered on 01 Apr 2013, 02:52 PM
Hello Eric,

I am glad to see that you work can continue without any troubles with the designer. Let me know in case you encounter any further problems with that. 

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Joe
Top achievements
Rank 1
answered on 19 Apr 2013, 07:24 AM
I am getting the same issue, so I am interested to know if anyone has figured out how to resolve this.  I have Telerik.Windows.Data.dll references but also cannot find System.Windows.Data.dll.

It is very frustrating as I cannot see a visual designer and am working with some rather complex views.

0
Maya
Telerik team
answered on 19 Apr 2013, 08:08 AM
Hello Joe,

We did not manage to reproduce the behavior on our side and consequently, we could not debug it and provide a solution. Could you clarify what your settings are and how you reproduce it ? Is there anything more specific ? 


Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Eric
Top achievements
Rank 1
answered on 19 Apr 2013, 03:06 PM
Hey Joe,

I swear there is a bug in visual studio as I still get this error occassionally too; HOWEVER, I tried some new techniques which seem to work much better because I can see my views in the designer.

First, I found that when radgridview starts showing that error about system.windows.data.dll (which is weird because I don't believe there is such a lib) I could fix the error with a clean and rebuild. If that doesn't work then kiling the designer process (XDesProc.exe) from task manager and then reloading it from the designer will sometimes work. And if that doesn't, then restarting visual studio seems to do the trick.

As far as code, hopefully the following will give you some ideas as I have no idea of what your solution looks like. I use mvvmlight so I bind my viewmodels thru viewmodellocator statically in my views and I was also binding a designtime instance using d:datacontext thinking that the designer would just choose this one at design time. The designer can actually spin up either so I think I was having some kind of conflict (you can debug the designer process in a separate instance of vs just google it if you're curious). My viewmodellocator was bombing out in the getters for my viewmodels because I resolve them from an ioc container.

So I decided to rip out all of the d: designtime bindings in favor of using the real viewmodels being bound via the vml and applied some new techniques consisting of a new build configuration specifically for design with compiler directives to build designer versions of my viewmodels, which is also cool because it's an easier way to exclude designer code from your prod build.

Anyway, hopefully some part of my rambling will help you out but if you want more detail just give me a holler and I'll try to put together a simple example or something.
0
jose luis
Top achievements
Rank 1
answered on 12 Jul 2013, 09:42 AM
Hello

If you open with visual studio 2012 the Telerik CRm solution and open in design mode CRM.Companies -> CompaniesListUserControl.xaml you get this error also at:


<telerik:RadGridView ItemsSource="{Binding Companies}" ColumnWidth="*" Grid.Row="1"
                       helpers:GridViewColumnHelper.HideGroupedColumns="True"
                       helpers:GridViewColumnHelper.HideNonImportantColumns="{Binding IsInOverviewState}"
                       SelectedItem="{Binding SelectedCompany, Mode=TwoWay}"
                       AutoExpandGroups="True" AutoGenerateColumns="False">

with visual studio standard settings, and rad controls version 2013.2 611.

Could yo explain wich kind of d: references you could put inside the XAMl to avoid this problem?

Thanks
0
Maya
Telerik team
answered on 15 Jul 2013, 08:06 AM
Hi Jose,

Unfortunately, I am not able to get any exception on the example you mentioned as well. Will it be possible to check this small video to see whether I am missing something ?  Are all the references from the folder of the application - \CRM_Trial_2013_1_0611_SourceCode\Binaries ?

Regards,
Maya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Seth
Top achievements
Rank 1
answered on 16 Sep 2017, 05:44 PM

I am having this issue even with the 2017 Telerik build.

I have a WPF application that employs the Telerik:RadGridView on serveral Pages and User Controls. The Telerik version was originally 2016 and everything worked well (Designer view and all).

We have since upgraded our Telerik libraries to the 2017 R2. The existing telerik:RadGridView controls work well after updating the DLLs; however, I am trying to create a new User Control in a project where the Telerik libraries did not yet exist. I had to drag the RadGridView from the Toolbox to allow it the code updates for all of the required libraries. Once the IDE was finished, I immediate received the error that "The local property "ItemsSource" can only be applied to types that are derived from "DataControl""

I do have the System.Windows.Data, Telerik.Windows.Data and Telerik.Windows.Controls.GridView in my xaml.cs file.

I do have the project set for the Target framework: .NET Framework 4 Client Profile.

I have tried to mirror all aspects between my working project and my non-working project that I could change and the Designer view fails to display with the ItemsSource error. Even though the working Project has no issues showing a RadGridView with an ItemsSource property set.

Also, the problem appears to not be only limited to the Designer. In my User Control, i have a RadGridView and a WPF DataGrid. Both are pointed to the same source in a ViewModel. Yet the WPF DataGrid populates fine, but the RadGridView remains empty.

0
Martin
Telerik team
answered on 20 Sep 2017, 10:28 AM
Seth,

I guess the problem is related to wrongly referenced binaries. 

May I ask you to check the exact version of Telerik.Windows.Controls.GridView binary is referenced to the new project and assure that all of the binaries are with the same version.

Regards,
Martin Vatev
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Gaurav
Top achievements
Rank 1
Eric
Top achievements
Rank 1
Maya
Telerik team
Joe
Top achievements
Rank 1
jose luis
Top achievements
Rank 1
Seth
Top achievements
Rank 1
Martin
Telerik team
Share this question
or