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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGroupingControl - Updating DataTable on a thread

Thread ID:





22771 Dec 21,2004 08:07 PM Dec 22,2004 02:03 AM Windows Forms 1
Tags: GridControl
Sameer Patil
Asked On December 21, 2004 08:07 PM

Hi I am using a GridGroupingControl that is bound to a DataTable. I have a separate thread running that updates this datatable periodically. Is this a safe? It works fine for me. i.e. the grid automatically updates itself as the data changes. But another user can often see exceptions such as the following when they click on the grid while a data table update is in progress. What could be the reason for this? catched at Syncfusion.Windows.Forms.Grid.GridPaint.DrawClientRowCol(Int32 topRow, Int32 leftCol, Int32 bottomRow, Int32 rightCol, Graphics g, Rectangle rectClip) in :line 0 catched at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) in :line 0 catched at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.SynchronizeGridWithEngine() in :line 0 Dec 16 15:57:25 ha054519 fidfir/IPS/1.0 [2000] 236 Error fidfir/IPS/1.0 Object reference not set to an instance of an object. at Syncfusion.Styles.StyleInfoBase.GetShortValue(StyleInfoProperty sip) at Syncfusion.Windows.Forms.Grid.Grouping.GridGroupOptionsStyleInfo.get_ShowColumnHeaders() at Syncfusion.Windows.Forms.Grid.Grouping.GridGroupExtend.IsChildVisible(Group owner, Element el, GridGroupOptionsStyleInfo go) at Syncfusion.Windows.Forms.Grid.Grouping.GridChildTable.IsChildVisible(Element el) at Syncfusion.Grouping.Internals.ElementHelper.GetNextSiblingElement(Element el, Int32 cookie) at Syncfusion.Grouping.Internals.ElementHelper.GetNextElementStepIn(Element el, Int32 cookie, Type finalType, Boolean stepInNestedTables, Table outerTable) at Syncfusion.Grouping.RuntimeElementsInTableCollectionEnumerator.MoveNext() at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.InternalGetFrozenRows() at Syncfusion.Windows.Forms.Grid.GridControlBase.GetClientRow(Int32 rowIndex) at Syncfusion.Windows.Forms.Grid.GridViewLayout.Initialize() at Syncfusion.Windows.Forms.Grid.GridViewLayout.DemandInitialize() at Syncfusion.Windows.Forms.Grid.GridViewLayout.PointToClientCol(Point pt, Boolean fixBackHidden, GridCellSizeKind sizeKind) at Syncfusion.Windows.Forms.Grid.GridViewLayout.PointToClientCol(Point pt, GridCellSizeKind sizeKind) at Syncfusion.Windows.Forms.Grid.GridControlBase.PointToRangeInfo(Point point, Int32 fixOutOfRange) at Syncfusion.Windows.Forms.Grid.GridControlBase.PointToRowCol(Point point, Int32& rowIndex, Int32& colIndex, Int32 fixOutOfRange) at Syncfusion.Windows.Forms.Grid.GridControlBase.PointToRowCol(Point point, Int32& rowIndex, Int32& colIndex) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.OnCellTipsMouseMove(MouseEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.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 Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.WndProc(Message& msg) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.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.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at MorganStanley.MSDotNet.MSNet.MSNetLoopUIImpl.Loop(Boolean showForm_) in m:\dev\msdotnet\msnet\1.0.4\src\assemblies\MSNet\MSNetLoopUIImpl.cs:line 141 at MorganStanley.MSDotNet.MSNet.MSNetLoopUIImpl.Loop() in m:\dev\msdotnet\msnet\1.0.4\src\assemblies\MSNet\MSNetLoopUIImpl.cs:line 250 at MorganStanley.fidfir.IPS.GUI.IPSMain.MSDEMain(String[] args) in C:\dev\fidfir\ips\dev\src\assemblies\IPS\GUI\IPSMain.cs:line 69 (PortfolioDataManager.MSDEMain) I am using version Thanks Sameer

Administrator [Syncfusion]
Replied On December 22, 2004 02:03 AM

You need to make sure anytime you interact with the grid you are on the thread that created the grid bu checking grid.InvokeRequired. Now our code tries to handle this for you, but there are still situations where it will be update to you to make sure things are set up properly. For example, if the datasource is created on the other thread, then you need to make sure the grid is using a currencymanager created on its thread. Here is a forum thread discussing this problem (for a GridDataBoundGrid but the idea applies to a GridGroupingControl also).


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon