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

CellBeginEdit

1 Answer 682 Views
GridView
This is a migrated thread and some comments may be shown as answers.
David Storey
Top achievements
Rank 1
David Storey asked on 10 Feb 2010, 04:04 PM
Hi,

Ive created a grid, one of my columns in the grid is a GridViewLookupColumn.  Ive subscribed to the CellBeginEdit event because I want to prevent users from editing certain cells.  When the condition is met in the event handler I set e.Cancel to true so that the editor is not displayed.  All works fine until the form is closed (disposed), I then get the following exception (stack trace), can somebody help please?

   at Telerik.WinControls.UI.PopupEditorBaseElement.ClosePopup(RadPopupCloseReason reason)
   at Telerik.WinControls.UI.PopupEditorBaseElement.DisposeManagedResources()
   at Telerik.WinControls.UI.RadComboBoxElement.DisposeManagedResources()
   at Telerik.WinControls.DisposableObject.PerformDispose(Boolean disposing)
   at Telerik.WinControls.RadElement.PerformDispose(Boolean disposing)
   at Telerik.WinControls.DisposableObject.Dispose(Boolean disposing)
   at Telerik.WinControls.DisposableObject.Dispose()
   at Telerik.WinControls.UI.GridViewEditManager.Dispose()
   at Telerik.WinControls.UI.RadGridView.savedForm_FormClosed(Object sender, FormClosedEventArgs e)
   at System.Windows.Forms.Form.OnFormClosed(FormClosedEventArgs e)
   at System.Windows.Forms.Form.CheckCloseDialog(Boolean closingOnly)
   at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FContinueMessageLoop(Int32 reason, Int32 pvLoopData, MSG[] msgPeeked)
   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.RunDialog(Form form)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at TelerikDataGridView.Form1.radGridView1_CellDoubleClick(Object sender, GridViewCellEventArgs e) in C:\Documents and Settings\dms\My Documents\Visual Studio 2008\Projects\TelerikDataGridView\TelerikDataGridView\Form3.cs:line 96
   at Telerik.WinControls.UI.RadGridView.OnCellDoubleClick(Object sender, GridViewCellEventArgs e)
   at Telerik.WinControls.UI.RadGridView.OnMouseDoubleClick(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at Telerik.WinControls.RadControl.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.RunDialog(Form form)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at TelerikDataGridView.Form4.button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\dms\My Documents\Visual Studio 2008\Projects\TelerikDataGridView\TelerikDataGridView\Form4.cs:line 23
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.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(Form mainForm)
   at TelerikDataGridView.Program.Main() in C:\Documents and Settings\dms\My Documents\Visual Studio 2008\Projects\TelerikDataGridView\TelerikDataGridView\Class1.cs:line 16
   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()

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 15 Feb 2010, 04:06 PM
Hi David Storey,

I have already answered your question in your first support ticket, but I'm just posting the answer here for the community:
 
The issue will be addressed in some of the next releases. Currently, there is a work-around using EndEdit method and canceling CellBeginEdit event:

void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) 
    if (radGridView1.Columns[e.ColumnIndex].FieldName == "Status"
    
        e.Cancel = true
        this.radGridView1.EndEdit(); 
    
}

Greetings,
Martin Vasilev
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.
Tags
GridView
Asked by
David Storey
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or