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

TargetInvocationException was unhandled

2 Answers 406 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tim Black
Top achievements
Rank 1
Tim Black asked on 16 Dec 2010, 08:39 PM
I'm getting the following error in my 1st WinForms application, using VS 2010 and Telerik Q2 2010.  It repeats on two different forms. 
Below, I've included the full error message, .ASPX code and .VB code.

Thanks

Error message:
System.Reflection.TargetInvocationException was unhandled
  Message=Exception has been thrown by the target of an invocation.
  Source=mscorlib
  StackTrace:
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at GrantManager.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.NullReferenceException
       Message=Object reference not set to an instance of an object.
       Source=Telerik.WinControls.GridView
       StackTrace:
            at Telerik.WinControls.UI.TableViewRowLayoutBase.InvalidateRenderColumns()
            at Telerik.WinControls.UI.TableViewRowLayout.InvalidateRenderColumns()
            at Telerik.WinControls.UI.RowsContainerElement.UpdateWhenColumnsChanged()
            at Telerik.WinControls.UI.GridTableElement.ProcessTemplateEvent(GridViewEvent eventData)
            at Telerik.WinControls.UI.GridTableElement.Telerik.WinControls.UI.IGridViewEventListener.ProcessEvent(GridViewEvent eventData)
            at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessCollection(GridViewEvent gridEvent, PriorityWeakReferenceList list, GridEventProcessMode processMode)
            at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessEvent(GridViewEvent gridEvent)
            at Telerik.WinControls.UI.GridViewSynchronizationService.NotifyListeners(GridViewEvent gridEvent)
            at Telerik.WinControls.UI.GridViewSynchronizationService.OnPostCallback(Object state)
       InnerException: 

ASPX code:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmDistribution
    Inherits System.Windows.Forms.Form
  
    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub
  
    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer
  
    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim GridViewDecimalColumn1 As Telerik.WinControls.UI.GridViewDecimalColumn = New Telerik.WinControls.UI.GridViewDecimalColumn()
        Dim GridViewDecimalColumn2 As Telerik.WinControls.UI.GridViewDecimalColumn = New Telerik.WinControls.UI.GridViewDecimalColumn()
        Dim GridViewDecimalColumn3 As Telerik.WinControls.UI.GridViewDecimalColumn = New Telerik.WinControls.UI.GridViewDecimalColumn()
        Dim GridViewTextBoxColumn1 As Telerik.WinControls.UI.GridViewTextBoxColumn = New Telerik.WinControls.UI.GridViewTextBoxColumn()
        Dim GridViewTextBoxColumn2 As Telerik.WinControls.UI.GridViewTextBoxColumn = New Telerik.WinControls.UI.GridViewTextBoxColumn()
        Dim GridViewDecimalColumn4 As Telerik.WinControls.UI.GridViewDecimalColumn = New Telerik.WinControls.UI.GridViewDecimalColumn()
        Dim GridViewTextBoxColumn3 As Telerik.WinControls.UI.GridViewTextBoxColumn = New Telerik.WinControls.UI.GridViewTextBoxColumn()
        Dim GridViewCheckBoxColumn1 As Telerik.WinControls.UI.GridViewCheckBoxColumn = New Telerik.WinControls.UI.GridViewCheckBoxColumn()
        Dim GridViewTextBoxColumn4 As Telerik.WinControls.UI.GridViewTextBoxColumn = New Telerik.WinControls.UI.GridViewTextBoxColumn()
        Dim GridViewTextBoxColumn5 As Telerik.WinControls.UI.GridViewTextBoxColumn = New Telerik.WinControls.UI.GridViewTextBoxColumn()
        Dim GridViewTextBoxColumn6 As Telerik.WinControls.UI.GridViewTextBoxColumn = New Telerik.WinControls.UI.GridViewTextBoxColumn()
        Dim GridViewTextBoxColumn7 As Telerik.WinControls.UI.GridViewTextBoxColumn = New Telerik.WinControls.UI.GridViewTextBoxColumn()
        Dim GridViewDateTimeColumn1 As Telerik.WinControls.UI.GridViewDateTimeColumn = New Telerik.WinControls.UI.GridViewDateTimeColumn()
        Dim GridViewTextBoxColumn8 As Telerik.WinControls.UI.GridViewTextBoxColumn = New Telerik.WinControls.UI.GridViewTextBoxColumn()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmDistribution))
        Me.pagMain = New Telerik.WinControls.UI.RadPageView()
        Me.itmSelect = New Telerik.WinControls.UI.RadPageViewPage()
        Me.lblSelectMsg = New System.Windows.Forms.Label()
        Me.cboType = New System.Windows.Forms.ComboBox()
        Me.dsType = New System.Windows.Forms.BindingSource(Me.components)
        Me.DstIntra = New GrantManager.dstIntra()
        Me.lblType = New System.Windows.Forms.Label()
        Me.lblRecCnt = New System.Windows.Forms.Label()
        Me.btnDelete = New System.Windows.Forms.Button()
        Me.btnEdit = New System.Windows.Forms.Button()
        Me.btnAdd = New System.Windows.Forms.Button()
        Me.grdSelect = New Telerik.WinControls.UI.RadGridView()
        Me.dsDist = New System.Windows.Forms.BindingSource(Me.components)
        Me.itmEdit = New Telerik.WinControls.UI.RadPageViewPage()
        Me.lblEditMsg = New System.Windows.Forms.Label()
        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
        Me.txtName = New System.Windows.Forms.TextBox()
        Me.btnSearch = New System.Windows.Forms.Button()
        Me.lblName = New System.Windows.Forms.Label()
        Me.cboAction = New System.Windows.Forms.ComboBox()
        Me.lblEmail = New System.Windows.Forms.Label()
        Me.lblAction = New System.Windows.Forms.Label()
        Me.txtEmail = New System.Windows.Forms.TextBox()
        Me.cboStatus = New System.Windows.Forms.ComboBox()
        Me.lblStatus = New System.Windows.Forms.Label()
        Me.btnCancel = New System.Windows.Forms.Button()
        Me.btnSave = New System.Windows.Forms.Button()
        Me.adpDist = New GrantManager.dstIntraTableAdapters.sp_grantappdist_select_bytypeTableAdapter()
        Me.adpType = New GrantManager.dstIntraTableAdapters.sp_grantapptype_selectTableAdapter()
        Me.dsStatus = New System.Windows.Forms.BindingSource(Me.components)
        Me.adpStatus = New GrantManager.dstIntraTableAdapters.sp_grantappstatus_selectTableAdapter()
        Me.dsAction = New System.Windows.Forms.BindingSource(Me.components)
        Me.adpAction = New GrantManager.dstIntraTableAdapters.sp_grantappaction_selectTableAdapter()
        CType(Me.pagMain, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.pagMain.SuspendLayout()
        Me.itmSelect.SuspendLayout()
        CType(Me.dsType, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DstIntra, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.grdSelect, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.dsDist, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.itmEdit.SuspendLayout()
        Me.GroupBox1.SuspendLayout()
        CType(Me.dsStatus, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.dsAction, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'pagMain
        '
        Me.pagMain.BackColor = System.Drawing.Color.Gainsboro
        Me.pagMain.Controls.Add(Me.itmSelect)
        Me.pagMain.Controls.Add(Me.itmEdit)
        Me.pagMain.Dock = System.Windows.Forms.DockStyle.Fill
        Me.pagMain.Font = New System.Drawing.Font("Verdana", 8.25!)
        Me.pagMain.Location = New System.Drawing.Point(0, 0)
        Me.pagMain.Name = "pagMain"
        Me.pagMain.SelectedPage = Me.itmSelect
        Me.pagMain.Size = New System.Drawing.Size(493, 296)
        Me.pagMain.TabIndex = 0
        CType(Me.pagMain.GetChildAt(0), Telerik.WinControls.UI.RadPageViewStripElement).StripButtons = Telerik.WinControls.UI.StripViewButtons.None
        '
        'itmSelect
        '
        Me.itmSelect.Controls.Add(Me.lblSelectMsg)
        Me.itmSelect.Controls.Add(Me.cboType)
        Me.itmSelect.Controls.Add(Me.lblType)
        Me.itmSelect.Controls.Add(Me.lblRecCnt)
        Me.itmSelect.Controls.Add(Me.btnDelete)
        Me.itmSelect.Controls.Add(Me.btnEdit)
        Me.itmSelect.Controls.Add(Me.btnAdd)
        Me.itmSelect.Controls.Add(Me.grdSelect)
        Me.itmSelect.Location = New System.Drawing.Point(10, 21)
        Me.itmSelect.Name = "itmSelect"
        Me.itmSelect.Size = New System.Drawing.Size(472, 264)
        '
        'lblSelectMsg
        '
        Me.lblSelectMsg.Location = New System.Drawing.Point(210, 244)
        Me.lblSelectMsg.Name = "lblSelectMsg"
        Me.lblSelectMsg.Size = New System.Drawing.Size(250, 13)
        Me.lblSelectMsg.TabIndex = 7
        Me.lblSelectMsg.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'cboType
        '
        Me.cboType.DataSource = Me.dsType
        Me.cboType.DisplayMember = "appname"
        Me.cboType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboType.FormattingEnabled = True
        Me.cboType.Location = New System.Drawing.Point(5, 17)
        Me.cboType.Name = "cboType"
        Me.cboType.Size = New System.Drawing.Size(165, 21)
        Me.cboType.TabIndex = 1
        Me.cboType.ValueMember = "grantapptypeid"
        '
        'dsType
        '
        Me.dsType.DataMember = "sp_grantapptype_select"
        Me.dsType.DataSource = Me.DstIntra
        '
        'DstIntra
        '
        Me.DstIntra.DataSetName = "dstIntra"
        Me.DstIntra.EnforceConstraints = False
        Me.DstIntra.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'lblType
        '
        Me.lblType.AutoSize = True
        Me.lblType.Location = New System.Drawing.Point(4, 1)
        Me.lblType.Name = "lblType"
        Me.lblType.Size = New System.Drawing.Size(35, 13)
        Me.lblType.TabIndex = 0
        Me.lblType.Text = "Type"
        '
        'lblRecCnt
        '
        Me.lblRecCnt.Font = New System.Drawing.Font("Verdana", 8.25!)
        Me.lblRecCnt.ForeColor = System.Drawing.Color.Blue
        Me.lblRecCnt.Location = New System.Drawing.Point(359, 24)
        Me.lblRecCnt.Name = "lblRecCnt"
        Me.lblRecCnt.Size = New System.Drawing.Size(226, 14)
        Me.lblRecCnt.TabIndex = 3
        Me.lblRecCnt.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'btnDelete
        '
        Me.btnDelete.Location = New System.Drawing.Point(133, 239)
        Me.btnDelete.Name = "btnDelete"
        Me.btnDelete.Size = New System.Drawing.Size(58, 23)
        Me.btnDelete.TabIndex = 6
        Me.btnDelete.Text = "Delete"
        Me.btnDelete.UseVisualStyleBackColor = True
        '
        'btnEdit
        '
        Me.btnEdit.Location = New System.Drawing.Point(69, 239)
        Me.btnEdit.Name = "btnEdit"
        Me.btnEdit.Size = New System.Drawing.Size(58, 23)
        Me.btnEdit.TabIndex = 5
        Me.btnEdit.Text = "Edit"
        Me.btnEdit.UseVisualStyleBackColor = True
        '
        'btnAdd
        '
        Me.btnAdd.Location = New System.Drawing.Point(5, 239)
        Me.btnAdd.Name = "btnAdd"
        Me.btnAdd.Size = New System.Drawing.Size(58, 23)
        Me.btnAdd.TabIndex = 4
        Me.btnAdd.Text = "Add"
        Me.btnAdd.UseVisualStyleBackColor = True
        '
        'grdSelect
        '
        Me.grdSelect.BackColor = System.Drawing.Color.Gainsboro
        Me.grdSelect.Cursor = System.Windows.Forms.Cursors.Default
        Me.grdSelect.EnableFastScrolling = True
        Me.grdSelect.Font = New System.Drawing.Font("Verdana", 8.25!)
        Me.grdSelect.ForeColor = System.Drawing.SystemColors.ControlText
        Me.grdSelect.ImeMode = System.Windows.Forms.ImeMode.NoControl
        Me.grdSelect.Location = New System.Drawing.Point(5, 41)
        '
        'grdSelect
        '
        Me.grdSelect.MasterTemplate.AllowAddNewRow = False
        Me.grdSelect.MasterTemplate.AllowDeleteRow = False
        Me.grdSelect.MasterTemplate.AllowDragToGroup = False
        Me.grdSelect.MasterTemplate.AllowEditRow = False
        Me.grdSelect.MasterTemplate.AllowRowResize = False
        GridViewDecimalColumn1.DataType = GetType(Integer)
        GridViewDecimalColumn1.FieldName = "grantappdistid"
        GridViewDecimalColumn1.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewDecimalColumn1.HeaderText = "grantappdistid"
        GridViewDecimalColumn1.IsAutoGenerated = True
        GridViewDecimalColumn1.IsVisible = False
        GridViewDecimalColumn1.Name = "grantappdistid"
        GridViewDecimalColumn1.ReadOnly = True
        GridViewDecimalColumn1.TextAlignment = System.Drawing.ContentAlignment.MiddleRight
        GridViewDecimalColumn2.DataType = GetType(Byte)
        GridViewDecimalColumn2.FieldName = "grantappstatusid"
        GridViewDecimalColumn2.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewDecimalColumn2.HeaderText = "grantappstatusid"
        GridViewDecimalColumn2.IsAutoGenerated = True
        GridViewDecimalColumn2.IsVisible = False
        GridViewDecimalColumn2.Name = "grantappstatusid"
        GridViewDecimalColumn2.TextAlignment = System.Drawing.ContentAlignment.MiddleRight
        GridViewDecimalColumn3.DataType = GetType(Byte)
        GridViewDecimalColumn3.FieldName = "grantapptypeid"
        GridViewDecimalColumn3.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewDecimalColumn3.HeaderText = "grantapptypeid"
        GridViewDecimalColumn3.IsAutoGenerated = True
        GridViewDecimalColumn3.IsVisible = False
        GridViewDecimalColumn3.Name = "grantapptypeid"
        GridViewDecimalColumn3.TextAlignment = System.Drawing.ContentAlignment.MiddleRight
        GridViewTextBoxColumn1.FieldName = "grantapptype"
        GridViewTextBoxColumn1.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewTextBoxColumn1.HeaderText = "grantapptype"
        GridViewTextBoxColumn1.IsAutoGenerated = True
        GridViewTextBoxColumn1.IsVisible = False
        GridViewTextBoxColumn1.Name = "grantapptype"
        GridViewTextBoxColumn2.FieldName = "grantappstatus"
        GridViewTextBoxColumn2.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewTextBoxColumn2.HeaderText = "Status"
        GridViewTextBoxColumn2.HeaderTextAlignment = System.Drawing.ContentAlignment.MiddleLeft
        GridViewTextBoxColumn2.IsAutoGenerated = True
        GridViewTextBoxColumn2.Name = "grantappstatus"
        GridViewTextBoxColumn2.ReadOnly = True
        GridViewTextBoxColumn2.Width = 120
        GridViewDecimalColumn4.DataType = GetType(Byte)
        GridViewDecimalColumn4.FieldName = "grantappactionid"
        GridViewDecimalColumn4.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewDecimalColumn4.HeaderText = "grantappactionid"
        GridViewDecimalColumn4.IsAutoGenerated = True
        GridViewDecimalColumn4.IsVisible = False
        GridViewDecimalColumn4.Name = "grantappactionid"
        GridViewDecimalColumn4.TextAlignment = System.Drawing.ContentAlignment.MiddleRight
        GridViewTextBoxColumn3.FieldName = "grantappaction"
        GridViewTextBoxColumn3.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewTextBoxColumn3.HeaderText = "Action"
        GridViewTextBoxColumn3.HeaderTextAlignment = System.Drawing.ContentAlignment.MiddleLeft
        GridViewTextBoxColumn3.IsAutoGenerated = True
        GridViewTextBoxColumn3.Name = "grantappaction"
        GridViewTextBoxColumn3.ReadOnly = True
        GridViewTextBoxColumn3.Width = 100
        GridViewCheckBoxColumn1.FieldName = "employee"
        GridViewCheckBoxColumn1.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewCheckBoxColumn1.HeaderText = "E"
        GridViewCheckBoxColumn1.IsAutoGenerated = True
        GridViewCheckBoxColumn1.MinWidth = 20
        GridViewCheckBoxColumn1.Name = "employee"
        GridViewCheckBoxColumn1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter
        GridViewCheckBoxColumn1.Width = 20
        GridViewTextBoxColumn4.FieldName = "employeeid"
        GridViewTextBoxColumn4.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewTextBoxColumn4.HeaderText = "employeeid"
        GridViewTextBoxColumn4.IsAutoGenerated = True
        GridViewTextBoxColumn4.IsVisible = False
        GridViewTextBoxColumn4.Name = "employeeid"
        GridViewTextBoxColumn5.FieldName = "fullname"
        GridViewTextBoxColumn5.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewTextBoxColumn5.HeaderText = "Employee"
        GridViewTextBoxColumn5.HeaderTextAlignment = System.Drawing.ContentAlignment.MiddleLeft
        GridViewTextBoxColumn5.IsAutoGenerated = True
        GridViewTextBoxColumn5.Name = "fullname"
        GridViewTextBoxColumn5.ReadOnly = True
        GridViewTextBoxColumn5.Width = 200
        GridViewTextBoxColumn6.FieldName = "email"
        GridViewTextBoxColumn6.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewTextBoxColumn6.HeaderText = "email"
        GridViewTextBoxColumn6.IsAutoGenerated = True
        GridViewTextBoxColumn6.IsVisible = False
        GridViewTextBoxColumn6.Name = "email"
        GridViewTextBoxColumn7.FieldName = "phone"
        GridViewTextBoxColumn7.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewTextBoxColumn7.HeaderText = "phone"
        GridViewTextBoxColumn7.IsAutoGenerated = True
        GridViewTextBoxColumn7.IsVisible = False
        GridViewTextBoxColumn7.Name = "phone"
        GridViewDateTimeColumn1.FieldName = "createdate"
        GridViewDateTimeColumn1.Format = System.Windows.Forms.DateTimePickerFormat.[Long]
        GridViewDateTimeColumn1.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewDateTimeColumn1.HeaderText = "createdate"
        GridViewDateTimeColumn1.IsAutoGenerated = True
        GridViewDateTimeColumn1.IsVisible = False
        GridViewDateTimeColumn1.Name = "createdate"
        GridViewTextBoxColumn8.FieldName = "createid"
        GridViewTextBoxColumn8.FormatInfo = New System.Globalization.CultureInfo("")
        GridViewTextBoxColumn8.HeaderText = "createid"
        GridViewTextBoxColumn8.IsAutoGenerated = True
        GridViewTextBoxColumn8.IsVisible = False
        GridViewTextBoxColumn8.Name = "createid"
        Me.grdSelect.MasterTemplate.Columns.AddRange(New Telerik.WinControls.UI.GridViewDataColumn() {GridViewDecimalColumn1, GridViewDecimalColumn2, GridViewDecimalColumn3, GridViewTextBoxColumn1, GridViewTextBoxColumn2, GridViewDecimalColumn4, GridViewTextBoxColumn3, GridViewCheckBoxColumn1, GridViewTextBoxColumn4, GridViewTextBoxColumn5, GridViewTextBoxColumn6, GridViewTextBoxColumn7, GridViewDateTimeColumn1, GridViewTextBoxColumn8})
        Me.grdSelect.MasterTemplate.DataSource = Me.dsDist
        Me.grdSelect.MasterTemplate.EnableGrouping = False
        Me.grdSelect.MasterTemplate.ShowRowHeaderColumn = False
        Me.grdSelect.Name = "grdSelect"
        Me.grdSelect.Padding = New System.Windows.Forms.Padding(0, 0, 0, 1)
        Me.grdSelect.RightToLeft = System.Windows.Forms.RightToLeft.No
        '
        '
        '
        Me.grdSelect.RootElement.Padding = New System.Windows.Forms.Padding(0, 0, 0, 1)
        Me.grdSelect.ShowGroupPanel = False
        Me.grdSelect.Size = New System.Drawing.Size(459, 192)
        Me.grdSelect.StandardTab = True
        Me.grdSelect.TabIndex = 2
        Me.grdSelect.Text = "RadGridView1"
        '
        'dsDist
        '
        Me.dsDist.DataMember = "sp_grantappdist_select_bytype"
        Me.dsDist.DataSource = Me.DstIntra
        '
        'itmEdit
        '
        Me.itmEdit.Controls.Add(Me.lblEditMsg)
        Me.itmEdit.Controls.Add(Me.GroupBox1)
        Me.itmEdit.Controls.Add(Me.btnCancel)
        Me.itmEdit.Controls.Add(Me.btnSave)
        Me.itmEdit.Location = New System.Drawing.Point(10, 21)
        Me.itmEdit.Name = "itmEdit"
        Me.itmEdit.Size = New System.Drawing.Size(472, 264)
        '
        'lblEditMsg
        '
        Me.lblEditMsg.Location = New System.Drawing.Point(90, 212)
        Me.lblEditMsg.Name = "lblEditMsg"
        Me.lblEditMsg.Size = New System.Drawing.Size(290, 13)
        Me.lblEditMsg.TabIndex = 12
        Me.lblEditMsg.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.Add(Me.txtName)
        Me.GroupBox1.Controls.Add(Me.btnSearch)
        Me.GroupBox1.Controls.Add(Me.lblName)
        Me.GroupBox1.Controls.Add(Me.cboAction)
        Me.GroupBox1.Controls.Add(Me.lblEmail)
        Me.GroupBox1.Controls.Add(Me.lblAction)
        Me.GroupBox1.Controls.Add(Me.txtEmail)
        Me.GroupBox1.Controls.Add(Me.cboStatus)
        Me.GroupBox1.Controls.Add(Me.lblStatus)
        Me.GroupBox1.Location = New System.Drawing.Point(87, 29)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(296, 151)
        Me.GroupBox1.TabIndex = 11
        Me.GroupBox1.TabStop = False
        '
        'txtName
        '
        Me.txtName.Location = New System.Drawing.Point(15, 30)
        Me.txtName.MaxLength = 100
        Me.txtName.Name = "txtName"
        Me.txtName.Size = New System.Drawing.Size(231, 21)
        Me.txtName.TabIndex = 1
        '
        'btnSearch
        '
        Me.btnSearch.Image = Global.GrantManager.My.Resources.Resources.magnifier2
        Me.btnSearch.Location = New System.Drawing.Point(252, 29)
        Me.btnSearch.Name = "btnSearch"
        Me.btnSearch.Size = New System.Drawing.Size(28, 23)
        Me.btnSearch.TabIndex = 2
        Me.btnSearch.UseVisualStyleBackColor = True
        '
        'lblName
        '
        Me.lblName.AutoSize = True
        Me.lblName.Location = New System.Drawing.Point(12, 14)
        Me.lblName.Name = "lblName"
        Me.lblName.Size = New System.Drawing.Size(40, 13)
        Me.lblName.TabIndex = 0
        Me.lblName.Text = "Name"
        '
        'cboAction
        '
        Me.cboAction.DataSource = Me.dsAction
        Me.cboAction.DisplayMember = "description"
        Me.cboAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboAction.FormattingEnabled = True
        Me.cboAction.Location = New System.Drawing.Point(154, 115)
        Me.cboAction.Name = "cboAction"
        Me.cboAction.Size = New System.Drawing.Size(126, 21)
        Me.cboAction.TabIndex = 8
        Me.cboAction.ValueMember = "grantappactionid"
        '
        'lblEmail
        '
        Me.lblEmail.AutoSize = True
        Me.lblEmail.Location = New System.Drawing.Point(12, 56)
        Me.lblEmail.Name = "lblEmail"
        Me.lblEmail.Size = New System.Drawing.Size(38, 13)
        Me.lblEmail.TabIndex = 3
        Me.lblEmail.Text = "Email"
        '
        'lblAction
        '
        Me.lblAction.AutoSize = True
        Me.lblAction.Location = New System.Drawing.Point(151, 99)
        Me.lblAction.Name = "lblAction"
        Me.lblAction.Size = New System.Drawing.Size(42, 13)
        Me.lblAction.TabIndex = 7
        Me.lblAction.Text = "Action"
        '
        'txtEmail
        '
        Me.txtEmail.Location = New System.Drawing.Point(15, 72)
        Me.txtEmail.MaxLength = 100
        Me.txtEmail.Name = "txtEmail"
        Me.txtEmail.Size = New System.Drawing.Size(265, 21)
        Me.txtEmail.TabIndex = 4
        '
        'cboStatus
        '
        Me.cboStatus.DataSource = Me.dsStatus
        Me.cboStatus.DisplayMember = "description"
        Me.cboStatus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboStatus.FormattingEnabled = True
        Me.cboStatus.Location = New System.Drawing.Point(17, 115)
        Me.cboStatus.Name = "cboStatus"
        Me.cboStatus.Size = New System.Drawing.Size(126, 21)
        Me.cboStatus.TabIndex = 6
        Me.cboStatus.ValueMember = "grantappstatusid"
        '
        'lblStatus
        '
        Me.lblStatus.AutoSize = True
        Me.lblStatus.Location = New System.Drawing.Point(14, 99)
        Me.lblStatus.Name = "lblStatus"
        Me.lblStatus.Size = New System.Drawing.Size(43, 13)
        Me.lblStatus.TabIndex = 5
        Me.lblStatus.Text = "Status"
        '
        'btnCancel
        '
        Me.btnCancel.Location = New System.Drawing.Point(239, 186)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.Size = New System.Drawing.Size(58, 23)
        Me.btnCancel.TabIndex = 10
        Me.btnCancel.Text = "Cancel"
        Me.btnCancel.UseVisualStyleBackColor = True
        '
        'btnSave
        '
        Me.btnSave.Location = New System.Drawing.Point(175, 186)
        Me.btnSave.Name = "btnSave"
        Me.btnSave.Size = New System.Drawing.Size(58, 23)
        Me.btnSave.TabIndex = 9
        Me.btnSave.Text = "Save"
        Me.btnSave.UseVisualStyleBackColor = True
        '
        'adpDist
        '
        Me.adpDist.ClearBeforeFill = True
        '
        'adpType
        '
        Me.adpType.ClearBeforeFill = True
        '
        'dsStatus
        '
        Me.dsStatus.DataMember = "sp_grantappstatus_select"
        Me.dsStatus.DataSource = Me.DstIntra
        '
        'adpStatus
        '
        Me.adpStatus.ClearBeforeFill = True
        '
        'dsAction
        '
        Me.dsAction.DataMember = "sp_grantappaction_select"
        Me.dsAction.DataSource = Me.DstIntra
        '
        'adpAction
        '
        Me.adpAction.ClearBeforeFill = True
        '
        'frmDistribution
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.BackColor = System.Drawing.Color.Gainsboro
        Me.ClientSize = New System.Drawing.Size(493, 296)
        Me.Controls.Add(Me.pagMain)
        Me.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmDistribution"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Distribution List"
        CType(Me.pagMain, System.ComponentModel.ISupportInitialize).EndInit()
        Me.pagMain.ResumeLayout(False)
        Me.itmSelect.ResumeLayout(False)
        Me.itmSelect.PerformLayout()
        CType(Me.dsType, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DstIntra, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.grdSelect, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.dsDist, System.ComponentModel.ISupportInitialize).EndInit()
        Me.itmEdit.ResumeLayout(False)
        Me.GroupBox1.ResumeLayout(False)
        Me.GroupBox1.PerformLayout()
        CType(Me.dsStatus, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.dsAction, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
  
    End Sub
    Friend WithEvents pagMain As Telerik.WinControls.UI.RadPageView
    Friend WithEvents itmSelect As Telerik.WinControls.UI.RadPageViewPage
    Friend WithEvents itmEdit As Telerik.WinControls.UI.RadPageViewPage
    Friend WithEvents grdSelect As Telerik.WinControls.UI.RadGridView
    Friend WithEvents lblName As System.Windows.Forms.Label
    Friend WithEvents btnDelete As System.Windows.Forms.Button
    Friend WithEvents btnEdit As System.Windows.Forms.Button
    Friend WithEvents btnAdd As System.Windows.Forms.Button
    Friend WithEvents btnCancel As System.Windows.Forms.Button
    Friend WithEvents btnSave As System.Windows.Forms.Button
    Friend WithEvents lblRecCnt As System.Windows.Forms.Label
    Friend WithEvents cboType As System.Windows.Forms.ComboBox
    Friend WithEvents lblType As System.Windows.Forms.Label
    Friend WithEvents dsDist As System.Windows.Forms.BindingSource
    Friend WithEvents DstIntra As GrantManager.dstIntra
    Friend WithEvents adpDist As GrantManager.dstIntraTableAdapters.sp_grantappdist_select_bytypeTableAdapter
    Friend WithEvents dsType As System.Windows.Forms.BindingSource
    Friend WithEvents adpType As GrantManager.dstIntraTableAdapters.sp_grantapptype_selectTableAdapter
    Friend WithEvents txtName As System.Windows.Forms.TextBox
    Friend WithEvents txtEmail As System.Windows.Forms.TextBox
    Friend WithEvents lblEmail As System.Windows.Forms.Label
    Friend WithEvents cboAction As System.Windows.Forms.ComboBox
    Friend WithEvents lblAction As System.Windows.Forms.Label
    Friend WithEvents cboStatus As System.Windows.Forms.ComboBox
    Friend WithEvents lblStatus As System.Windows.Forms.Label
    Friend WithEvents btnSearch As System.Windows.Forms.Button
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents lblSelectMsg As System.Windows.Forms.Label
    Friend WithEvents lblEditMsg As System.Windows.Forms.Label
    Friend WithEvents dsAction As System.Windows.Forms.BindingSource
    Friend WithEvents dsStatus As System.Windows.Forms.BindingSource
    Friend WithEvents adpStatus As GrantManager.dstIntraTableAdapters.sp_grantappstatus_selectTableAdapter
    Friend WithEvents adpAction As GrantManager.dstIntraTableAdapters.sp_grantappaction_selectTableAdapter
End Class

VB code:
Imports Telerik.WinControls.UI
Imports Telerik.WinControls
  
Public Class frmDistribution
  
    Private Sub frmDistribution_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        ' enable menu and toolbar button
        frmMDI.EnableButtons(Me.Name)
    End Sub
  
    Private Sub frmDistribution_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim objStrip As RadPageViewStripElement
        Dim objLayout As StripViewItemLayout
        Try
            ' verify select page visible and set back color
            With pagMain
                .SelectedPage = pagMain.Pages(0)
                .ViewElement.ContentArea.DrawFill = False
                .ViewElement.ContentArea.DrawBorder = False
                .ViewElement.BackColor = Color.Gainsboro
            End With
  
            ' set back color of pages
            pagMain.Pages(0).BackColor = Color.Gainsboro
            pagMain.Pages(1).BackColor = Color.Gainsboro
  
            ' hide tabs
            objStrip = (DirectCast((Me.pagMain.GetChildAt(0)), RadPageViewStripElement))
            objLayout = DirectCast(objStrip.ItemContainer.ItemLayout, StripViewItemLayout)
            objLayout.Visibility = ElementVisibility.Collapsed
  
            ' populate combos
            Me.adpType.Fill(Me.DstIntra.sp_grantapptype_select)
            Me.adpAction.Fill(Me.DstIntra.sp_grantappaction_select, True)
            Me.adpStatus.Fill(Me.DstIntra.sp_grantappstatus_select, True)
  
            ' load dist listing
            If cboType.SelectedIndex > -1 Then
                Me.adpDist.Fill(Me.DstIntra.sp_grantappdist_select_bytype, cboType.SelectedValue)
            Else
                Me.adpDist.Fill(Me.DstIntra.sp_grantappdist_select_bytype, 0)
            End If
  
        Catch ex As Exception
            MessageBox.Show("Error loading form: " + vbCrLf + ex.Message)
        End Try
    End Sub
  
    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        ' clear edit fields
        txtName.Text = ""
        txtEmail.Text = ""
        cboStatus.SelectedIndex = -1
        cboAction.SelectedIndex = -1
  
        ' display edit page
        pagMain.SelectedPage = pagMain.Pages(1)
    End Sub
  
    Private Sub btnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEdit.Click
        ' load edit fields
        txtName.Text = grdSelect.SelectedRows(0).Cells("fullname").Value
        txtEmail.Text = grdSelect.SelectedRows(0).Cells("email").Value
        cboStatus.SelectedIndex = grdSelect.SelectedRows(0).Cells("grantappstatusid").Value
        cboAction.SelectedIndex = grdSelect.SelectedRows(0).Cells("grantappactionid").Value
  
        ' display edit page
        pagMain.SelectedPage = pagMain.Pages(1)
    End Sub
  
    Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
        ' verify the want to delete record
        If MessageBox.Show("Delete the selected distribution record?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.No Then
            Exit Sub
        End If
  
        ' delete the record
  
    End Sub
  
    Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
  
    End Sub
  
    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        ' save the record
  
        ' return to select page
        pagMain.SelectedPage = pagMain.Pages(0)
    End Sub
  
    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        ' verify the want to cancel edit
        If MessageBox.Show("Cancel editing session?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.No Then
            Exit Sub
        End If
  
        ' return to select page
        pagMain.SelectedPage = pagMain.Pages(0)
    End Sub
  
    Private Sub cboType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboType.SelectedIndexChanged
        Try
            ' load dist listing
            If cboType.SelectedIndex > -1 Then
                Me.adpDist.Fill(Me.DstIntra.sp_grantappdist_select_bytype, cboType.SelectedValue)
            Else
                Me.adpDist.Fill(Me.DstIntra.sp_grantappdist_select_bytype, 0)
            End If
        Catch ex As Exception
            MessageBox.Show("Error selecting type: " + vbCrLf + ex.Message)
        End Try
    End Sub
  
End Class



2 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 16 Dec 2010, 10:01 PM
Hello Tim,

Wjilst I haven't tried your code yet (I am running the latest 2010 Q3 SP1 Version anyhow), I see that there was a similar error experienced and a resolution given in this forum post

Hope that helps, but let me know if you need more information
Regards,
Richard
0
Svett
Telerik team
answered on 21 Dec 2010, 01:47 PM
Hi Tim Black,

I cannot reproduce the issue with the supplied code snippet. I recommend upgrading to the latest version Q3 2010 SP1 (2010.3 10.1215). We have resolved a similar issue with the InvalidateRenderColumns method. If you still experience the issue, I would kindly ask you to open a ticket with attached project where the issue occurs. This will allow us to investigate your case further.

All the best,

Svett
the Telerik team

 

Check out the Q1 2011 Roadmap for Telerik Controls for Windows Forms.
Tags
GridView
Asked by
Tim Black
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Svett
Telerik team
Share this question
or