We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

PrepareViewStyleInfo

Hi

I have a problem with the DataBoundGrid. I get a error witch I can''t handle.

The application breaks down and I''m landing at the main entry point. My Call Stack is empty. The Grid works fine when I’ have a DataSet witch contains any data.

I put everything in the function in a try and catch, it doesn’t help anything.

I’m using Net 2.0 and Syncfusion 4.202.0.37.

Regards,
JPP

Exception: System.FormatException
Message: Input string was not in a correct format.
FullText: System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.String.System.IConvertible.ToInt32(IFormatProvider provider)
at System.Convert.ToInt32(Object value)
at Syncfusion.Windows.Forms.Grid.GridDataBoundTreeCellRenderer.OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.RaisePrepareViewStyleInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style)
at Syncfusion.Windows.Forms.Grid.GridControlBase.GetViewStyleInfo(Int32 rowIndex, Int32 colIndex, Boolean forceQueryCellInfo)
at Syncfusion.Windows.Forms.Grid.GridControlBase.GetCellRenderer(Int32 rowIndex, Int32 colIndex)
at Syncfusion.Windows.Forms.Grid.GridSelectCellsMouseController.SelectCellsHitTestInfo..ctor(GridControlBase grid, MouseEventArgs e, IMouseController controller)
at Syncfusion.Windows.Forms.Grid.GridSelectCellsMouseController.HitTest(MouseEventArgs e, IMouseController controller)
at Syncfusion.Windows.Forms.MouseControllerDispatcher.HitTest(Point point, MouseButtons mouseButton, Int32 clicks, IMouseController& controller)
at Syncfusion.Windows.Forms.MouseControllerDispatcher.ProcessMouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControllMouseControllerDispatcher.ScrollControlMouseMoveHandled(Object sender, MouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControl.OnScrollControlHandledMouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControl.OnMouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnMouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBaseImp.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)
at Syncfusion.Windows.Forms.Grid.GridControlBase.WndProc(Message& msg)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


StackTrace: at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at Unisg.Unit.Main.SendErrorMessage.SetMessage(Object obj)
at Unisg.Unit.Main.MainController.HandleUnhandledException(Object obj)
at Unisg.Unit.Main.MainController.OnApplicationThreadException(Object sender, ThreadExceptionEventArgs ev)
at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
at System.Windows.Forms.Control.WndProcException(Exception e)
at System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
at System.Windows.Forms.NativeWindow.Callback(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 Unisg.Unit.Main.MainController.StartApplication()
at Unisg.Unit.Main.MainController.Main()

WorkingSet: 8110080



1 Reply

AD Administrator Syncfusion Team August 12, 2006 09:00 AM UTC

I used an empty DataSet with related DataTables in a GridDataBoundGrid with ShowTreelines set to true. All I saw was an empty grid only showing the AddNew row and that row did not have the +/- button showing in it. No exceptions were thrown.

Are you handling any events (QueryCellInfo or any drawing events) where you might be setting values to the grid dynamically? Such events might have an effect on this behavior.

Are there multiple threads involved? If so, you can only interact with the grid on the thread that created it. Threading ssues can give rise to strange exceptions like this.


Loader.
Live Chat Icon For mobile
Up arrow icon