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

GridView crash

8 Answers 206 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stas
Top achievements
Rank 1
Stas asked on 16 Nov 2010, 01:04 PM
Hello,

Our firm checking several third party controls to buy.
I've downloaded the VS projects samples and converted it to VS 2010.
Project 15_CustomCells, If i'm tying to move scrollbar of the gridview, the application is crashing.
The exception details:

System.Reflection.TargetInvocationException was unhandled
  Message=Exception has been thrown by the target of an invocation.
  Source=mscorlib
  StackTrace:
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType 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.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       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 Telerik.WinControls.RadControl.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(IntPtr 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 _15_CustomCells.Program.Main() in J:\ third party controls .NET\Telerik\Telerik_RadControls_for_WinForms_VS_Projects\Grid\CS\RadGridView\15_CustomCells\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Reflection.TargetInvocationException
       Message=Exception has been thrown by the target of an invocation.
       Source=mscorlib
       StackTrace:
            at System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType)
            at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
            at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
            at System.Activator.CreateInstance(Type type, Object[] args)
            at Telerik.WinControls.UI.GridDataRowElement.CreateCell(GridViewColumn column)
            at Telerik.WinControls.UI.CellElementProvider.CreateElement(GridViewColumn data, Object context)
            at Telerik.WinControls.UI.CellElementProvider.GetElement(GridViewColumn data, Object context)
            at Telerik.WinControls.UI.BaseVirtualizedContainer`1.UpdateElement(Int32 position, T data)
            at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureElements()
            at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureOverride(SizeF availableSize)
            at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
            at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
            at Telerik.WinControls.UI.GridVirtualizedRowElement.MeasureElements(SizeF availableSize, SizeF clientSize, Padding borderThickness)
            at Telerik.WinControls.UI.LightVisualElement.MeasureOverride(SizeF availableSize)
            at Telerik.WinControls.UI.GridRowElement.MeasureOverride(SizeF availableSize)
            at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
            at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
            at Telerik.WinControls.UI.VirtualizedStackContainer`1.MeasureElementCore(RadElement element, SizeF availableSize)
            at Telerik.WinControls.UI.ScrollableRowsContainerElement.MeasureElementCore(RadElement element, SizeF availableSize)
            at Telerik.WinControls.UI.VirtualizedStackContainer`1.MeasureElement(IVirtualizedElement`1 element)
            at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureElements()
            at Telerik.WinControls.UI.ScrollableRowsContainerElement.MeasureOverride(SizeF availableSize)
            at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
            at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
            at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
       InnerException: System.NullReferenceException
            Message=Object reference not set to an instance of an object.
            Source=_15_CustomCells
            StackTrace:
                 at _15_CustomCells.ColorSwatchCellElement.SetContent() in J:\ third party controls .NET\Telerik\Telerik_RadControls_for_WinForms_VS_Projects\Grid\CS\RadGridView\15_CustomCells\ColorSwatchCellElement.cs:line 59
                 at Telerik.WinControls.UI.GridVirtualizedCellElement.Initialize(GridViewColumn column, GridRowElement row)
                 at _15_CustomCells.ColorSwatchCellElement..ctor(GridViewColumn column, GridRowElement row) in J:\ third party controls .NET\Telerik\Telerik_RadControls_for_WinForms_VS_Projects\Grid\CS\RadGridView\15_CustomCells\ColorSwatchCellElement.cs:line 11
            InnerException:

Regards,
Stas

8 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 16 Nov 2010, 01:58 PM
Hello,

First of all i would like to say that I'm glad to hear that you are interested in Telerik Controls, and i would like to welcome you to the forums.

First thing's first, there is a VS2010 solution included and it is called CSVS2010.sln.
Please test it with this one, and please set the target platform to X86 is it is not set already.

If you still have this problem please provide more details in which cases this occurs on exactly the steps required to replicate it.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
Stas
Top achievements
Rank 1
answered on 16 Nov 2010, 02:36 PM
Hi Emanuel,

The samples that i downloaded from http://www.telerik.com/documents/Telerik_RadControls_for_WinForms_Courseware.zip
not including such solution.
Can you send me the relevant link for download?

Regards,
Stas
0
Emanuel Varga
Top achievements
Rank 1
answered on 16 Nov 2010, 03:40 PM
Hello,

Please download the Free Trial from here and after you install the trial version you will have a Demos application, and under the install folder you have the source for the examples in the Demos application, usually under :
c:\Program Files\Telerik\RadControls for WinForms Q3 2010\Examples\ExamplesCSVS2010.sln

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
Stas
Top achievements
Rank 1
answered on 16 Nov 2010, 05:04 PM
Hi,

I found this solution, thank you.
I want to see working example for custom cell.
All examples that i saw is not working completly.
The last one i saw was http://www.telerik.com/support/kb/winforms/gridview/adding-custom-elements-inside-a-cell-when-it-is-in-edit-mode.aspx,
but Button_Click event is not working. Do you have any idea why?

Regards,
Stas


0
Stas
Top achievements
Rank 1
answered on 18 Nov 2010, 07:28 AM
No response...
0
Emanuel Varga
Top achievements
Rank 1
answered on 19 Nov 2010, 08:34 AM
Hello Stas,

Sorry for the very late reply, but everything has been crazy at my part this past week,

Please tell me what custom cell do you need (what elements should it contain and what should behavior are you expecting) and i will provide an example as soon as possible.

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
Stefan
Telerik team
answered on 19 Nov 2010, 09:04 AM
Hi Stas,

Thank you for reporting the KB article which needs an update. We will update it with high priority. I updated your Telerik points accordingly.

If I understand correctly, you have found a solution for this issue. If this is not the case, please write me back and I will be glad to help further.

Sincerely yours,
Stefan
the Telerik team
See What's New in RadControls for WinForms in Q3 2010 on Wednesday, November 17, 11am Eastern Time: Register here>>
0
Alexander
Telerik team
answered on 19 Nov 2010, 05:02 PM
Hello Stas,

Just a quick follow up.

The project in the KB article will work properly when using our upcoming service pack. I attached a sample project which demonstrates a workaround for the issue using the Q3 2010 version of RadGridView.

I hope it helps. Please write back if you have additional questions.

Best regards,
Alexander
the Telerik team
Get started with RadControls for WinForms with numerous videos and detailed documentation.
Tags
GridView
Asked by
Stas
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Stas
Top achievements
Rank 1
Stefan
Telerik team
Alexander
Telerik team
Share this question
or