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

RadGridView getting started document

1 Answer 215 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael Bouhuys
Top achievements
Rank 1
Michael Bouhuys asked on 24 Jun 2018, 05:59 PM
Following your "https://docs.telerik.com/devtools/wpf/controls/radgridview/getting-started/getting-started2#adding-radgridview-to-the-project" document but can't build the example. Trying to follow document to test programmatically filtering.
When I follow the examples I'm getting these messages in VS2017:
Severity Code Description Project File Line Suppression State
Error  gridView is not supported in a Windows Presentation Foundation (WPF) project. ProgrammaticFiltering F:\How-to and Research\C#\Telerik RadGridView\ProgrammaticFiltering\ProgrammaticFiltering\MainWindow.xaml 11
Error  The type 'local:gridView' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. ProgrammaticFiltering F:\How-to and Research\C#\Telerik RadGridView\ProgrammaticFiltering\ProgrammaticFiltering\MainWindow.xaml 11
Error  The namespace prefix "local" is not defined. ProgrammaticFiltering F:\How-to and Research\C#\Telerik RadGridView\ProgrammaticFiltering\ProgrammaticFiltering\MainWindow.xaml 11
Error  The namespace prefix "local" is not defined. ProgrammaticFiltering F:\How-to and Research\C#\Telerik RadGridView\ProgrammaticFiltering\ProgrammaticFiltering\MainWindow.xaml 11

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 27 Jun 2018, 11:11 AM
Hello Michael,

There are couple of issues in the attached files. The first one is that the 'local' namespace is missing. This namespace is a custom one that should be defined by the developer that uses the RadGridView control. It points to a namespace of the application you are developing and you can name it whatever you want. For example: 'local', 'example', 'demo', 'myCustomControl', etc. In your case the local namespace will look like this:
<Window x:Class="ProgrammaticFiltering.MainWindow"
        xmlns:local="clr-namespace:ProgrammaticFiltering"
        Title="MainWindow" Height="364.059" Width="815.803">
The second issue is that the view model defined in the Resources collection in Xaml doesn't point to the correct class. It should be MyViewModel. Here is an example in code:
<Grid.Resources>
  <local:MyViewModel x:Key="MyViewModel" />
</Grid.Resources>

I updated your files and attached them in this reply. I hope that helps.

Regards,
Martin Ivanov
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 allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Michael Bouhuys
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or