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

"Click here to add anew row" click on childrow exception

2 Answers 37 Views
GridView
This is a migrated thread and some comments may be shown as answers.
DenisCL
Top achievements
Rank 1
DenisCL asked on 04 May 2011, 01:23 PM
Hello,

I've met this morning a special behavior where an exception occurs.

I create a little project for it, and it's really easy to do it again.
(Project here)

Simply launch an instance of this project, click on little "+" to display Childrows and click on "click here to add a new row" in child table

You'll get an null reference exception

Any workaround for letting user adding a childrow?

Regards

Exception :
null reference exception
   at Telerik.WinControls.UI.GridViewNewRowInfo.FillParentData()
   at Telerik.WinControls.UI.GridViewNewRowInfo.InitializeNewRow()
   at Telerik.WinControls.UI.GridViewNewRowInfo.OnBeginEdit()
   at Telerik.WinControls.UI.GridViewEditManager.BeginEdit()
   at Telerik.WinControls.UI.GridRowBehavior.OnMouseUpLeft(MouseEventArgs e)
   at Telerik.WinControls.UI.GridNewRowBehavior.OnMouseUpLeft(MouseEventArgs e)
   at Telerik.WinControls.UI.GridRowBehavior.OnMouseUp(MouseEventArgs e)
   at Telerik.WinControls.UI.BaseGridBehavior.OnMouseUp(MouseEventArgs e)
   at Telerik.WinControls.UI.RadGridView.OnMouseUp(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.Run(Form mainForm)
   at TestGridView.Program.Main() dans C:\Users\coudeyre\Projets\TestGridView\TestGridView\Program.cs:ligne 17
   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()

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 09 May 2011, 10:10 AM
Hi DenisCL,

Thank you for writing.

Before getting to your question, I would like to notify you that I have edited your forum post and I have removed the link to the project, since the attached project contained our assemblies inside. If you are attaching projects which are publicly available, please do not add our assemblies inside. Once we get the project, we will add references to the required assemblies.

In regards to your question, the observed exception is caused, because you did not specify the relation between the master and the child templates. Attached you can find your project modified. Additionally, please refer to this help section, where you can find information about creating different types of hierarchy in RadGridView.

I hope the provided information addresses your question. Should you have any other questions, do not hesitate to contact us. 

All the best,
Stefan
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
0
DenisCL
Top achievements
Rank 1
answered on 10 May 2011, 11:04 AM
Hello,

Thanks for light and sorry for the source.

You did good.

I'll take care

Regards
Tags
GridView
Asked by
DenisCL
Top achievements
Rank 1
Answers by
Stefan
Telerik team
DenisCL
Top achievements
Rank 1
Share this question
or