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

Type RadGridView is not defined

2 Answers 235 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Betsy
Top achievements
Rank 1
Betsy asked on 23 May 2011, 04:23 PM
I have a VB Class Library that has a WPF Window in it with a RadGridView on the window.  My class library has references to Telerik.Windows.Controls, Telerik.Windows.Controls.Data, Telerik.Windows.Controls.GridView, Telerik.Windows.Controls.Input and Telerik.Windows.Data.  When I compile the class library I get the following error in the vb.g file of the WPF Window:
Error 1 Type 'Telerik.Windows.Controls.RadGridView' is not defined. C:\Development\BestpassEM\WPFInfrastructure\obj\Debug\Infrastructure\ResultsWindow.g.vb 58 35 Bestpass.UI.Infrastructure

What could be causing this?  The line it is occuring on is below.
#ExternalSource("..\..\..\Infrastructure\ResultsWindow.xaml",18)
<System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")>  _
Friend WithEvents datagrid As Telerik.Windows.Controls.RadGridView
  
#End ExternalSource

2 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 24 May 2011, 09:52 AM

Hi Heather,

That sure is a strange error. Could you please check if the project is compiled with .Net Client Profile. In case it is, may I ask you to try to change it to the full .Net framework.

Hope this helps.



Regards,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Betsy
Top achievements
Rank 1
answered on 27 May 2011, 03:52 PM
It is compiled with the full .Net framework.  Here is the .g file that opens with the error and the two lines that are in error are the two that specify Telerik.Windows.Controls.RadGridView.  The Error Correction Option wants to switch it to just RadGridView and then I compile fine.
#ExternalChecksum("..\..\..\Infrastructure\ResultsWindow.xaml","{406ea660-64cf-4c82-b6f0-42d48172a799}","D3D1B305819ECA790436F53F00201725")
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     Runtime Version:4.0.30319.225
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
  
Option Strict Off
Option Explicit On
  
Imports System
Imports System.Diagnostics
Imports System.Windows
Imports System.Windows.Automation
Imports System.Windows.Controls
Imports System.Windows.Controls.Primitives
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Ink
Imports System.Windows.Input
Imports System.Windows.Markup
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Media.Effects
Imports System.Windows.Media.Imaging
Imports System.Windows.Media.Media3D
Imports System.Windows.Media.TextFormatting
Imports System.Windows.Navigation
Imports System.Windows.Shapes
Imports System.Windows.Shell
Imports Telerik.Windows.Controls
Imports Telerik.Windows.Controls.Animation
Imports Telerik.Windows.Controls.DragDrop
Imports Telerik.Windows.Controls.GridView
Imports Telerik.Windows.Controls.Primitives
Imports Telerik.Windows.Controls.TransitionEffects
Imports Telerik.Windows.Controls.TreeListView
Imports Telerik.Windows.Data
Imports Telerik.Windows.Shapes
  
  
'''<summary>
'''ResultsWindow
'''</summary>
<Microsoft.VisualBasic.CompilerServices.DesignerGenerated(),  _
 System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")>  _
Partial Public Class ResultsWindow
    Inherits System.Windows.Window
    Implements System.Windows.Markup.IComponentConnector
      
      
    #ExternalSource("..\..\..\Infrastructure\ResultsWindow.xaml",18)
    <System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")>  _
    Friend WithEvents datagrid As Telerik.Windows.Controls.RadGridView
      
    #End ExternalSource
      
      
    #ExternalSource("..\..\..\Infrastructure\ResultsWindow.xaml",25)
    <System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")>  _
    Friend WithEvents closebutton As System.Windows.Controls.Button
      
    #End ExternalSource
      
    Private _contentLoaded As Boolean
      
    '''<summary>
    '''InitializeComponent
    '''</summary>
    <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
    Public Sub InitializeComponent() Implements System.Windows.Markup.IComponentConnector.InitializeComponent
        If _contentLoaded Then
            Return
        End If
        _contentLoaded = true
        Dim resourceLocater As System.Uri = New System.Uri("/Bestpass.UI.Infrastructure;component/infrastructure/resultswindow.xaml", System.UriKind.Relative)
          
        #ExternalSource("..\..\..\Infrastructure\ResultsWindow.xaml",1)
        System.Windows.Application.LoadComponent(Me, resourceLocater)
          
        #End ExternalSource
    End Sub
      
    <System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
     System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never),  _
     System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes"),  _
     System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity"),  _
     System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")>  _
    Sub System_Windows_Markup_IComponentConnector_Connect(ByVal connectionId As Integer, ByVal target As Object) Implements System.Windows.Markup.IComponentConnector.Connect
        If (connectionId = 1) Then
              
            #ExternalSource("..\..\..\Infrastructure\ResultsWindow.xaml",10)
            AddHandler CType(target,System.Windows.Controls.MenuItem).Click, New System.Windows.RoutedEventHandler(AddressOf Me.savetofilemenu_Click)
              
            #End ExternalSource
            Return
        End If
        If (connectionId = 2) Then
            Me.datagrid = CType(target,Telerik.Windows.Controls.RadGridView)
            Return
        End If
        If (connectionId = 3) Then
            Me.closebutton = CType(target,System.Windows.Controls.Button)
            Return
        End If
        Me._contentLoaded = true
    End Sub
End Class
Tags
GridView
Asked by
Betsy
Top achievements
Rank 1
Answers by
Milan
Telerik team
Betsy
Top achievements
Rank 1
Share this question
or