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

Issue: Column re-ordering

3 Answers 113 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
Agustin M Rodriguez, MCSD, MCPD asked on 21 Sep 2009, 03:49 PM
I have been experiancing a System.NullReferenceException any time I call <RadGridView>.ReorderColumns(oldIndex, newIndex);

If I wrap the call in a try/catch block the column will reorder without any appearant issues.  I can also use the Move() method on the Columns collection, however I do not know what other tasks the ReorderColumns() method does.

The call to the ReorderColumns is being done on the  RadGridView.DataLoaded() event.  I am aware that this event is raised quite a few times, for this reason I currently I set a flag in the RadGridView.DataLoading event to prevent the reordering from being called multiple times.  So far this is the best event I can find to reorder after columns are auto-generated and data is loaded, however if you have a better suggestion I would appriciate it.

[Failed Trace]
EventFired: ContentGrid: DataLoading: 21ff2867-b39a-4611-a997-78b24a9a0a6b
SourceEvent: 21ff2867-b39a-4611-a997-78b24a9a0a6b: _reorderColumnsAfterDataLoad was set to true
EventFired: ContentGrid: AutoGeneratingColumn: d5fbbe6b-0be9-4d03-8c46-f3cb2ee9a4bd
SourceEvent: d5fbbe6b-0be9-4d03-8c46-f3cb2ee9a4bd: Column [IsActive] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: e0368147-9f2d-49fa-b8ce-087798c7481d
SourceEvent: e0368147-9f2d-49fa-b8ce-087798c7481d: Column [ProjectUH] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 385288a6-244c-4636-ab4f-e877da05d91a
SourceEvent: 385288a6-244c-4636-ab4f-e877da05d91a: Column [Number] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 054ce902-014e-4839-b2b8-7df1c9d00ad7
SourceEvent: 054ce902-014e-4839-b2b8-7df1c9d00ad7: Column [Name] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 834df67b-a261-4208-b242-e9b58bbc348c
SourceEvent: 834df67b-a261-4208-b242-e9b58bbc348c: Column [UserCreatedDT] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 0527534a-9f31-4c7a-bae5-cc4f44c1b0a7
SourceEvent: 0527534a-9f31-4c7a-bae5-cc4f44c1b0a7: Column [Description] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: eda8314b-203a-4d14-b96c-e4bbe71049c7
SourceEvent: eda8314b-203a-4d14-b96c-e4bbe71049c7: Column [Tax] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 52c4964a-5600-4cf2-8284-b2b4e04aa776
SourceEvent: 52c4964a-5600-4cf2-8284-b2b4e04aa776: Column [Multiplier] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 9972aca9-ceac-44dc-9be3-c5da6cdfac82
SourceEvent: 9972aca9-ceac-44dc-9be3-c5da6cdfac82: Column [Total] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 03a4223f-398f-4cc9-a8b8-eec6011cd193
SourceEvent: 03a4223f-398f-4cc9-a8b8-eec6011cd193: Column [Billing_Address1] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 135f4fe0-3809-40dd-b947-97c735c6bff6
SourceEvent: 135f4fe0-3809-40dd-b947-97c735c6bff6: Column [Billing_Address2] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: f364e8fc-469d-429b-849b-2da065f82ad9
SourceEvent: f364e8fc-469d-429b-849b-2da065f82ad9: Column [Billing_City] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 17e945e7-8b57-4e1e-b43c-f98f0220c99c
SourceEvent: 17e945e7-8b57-4e1e-b43c-f98f0220c99c: Column [Billing_State] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: ce44d499-976d-41ef-9a1d-59d0ba2b0569
SourceEvent: ce44d499-976d-41ef-9a1d-59d0ba2b0569: Column [Billing_Zip] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: d98b1928-f855-4b3c-9a4a-b634a765dc1e
SourceEvent: d98b1928-f855-4b3c-9a4a-b634a765dc1e: Column [Billing_Country] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 75a6654b-683f-4401-a8d4-be50f4dac023
SourceEvent: 75a6654b-683f-4401-a8d4-be50f4dac023: Column [Shipping_Address1] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 8fa98374-fa77-411c-ba16-eeb9a609960a
SourceEvent: 8fa98374-fa77-411c-ba16-eeb9a609960a: Column [Shipping_Address2] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: de64b536-e9e4-4aad-be12-be512f81003a
SourceEvent: de64b536-e9e4-4aad-be12-be512f81003a: Column [Shipping_City] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: a16a2d60-4856-4914-8c0f-e3998e76f493
SourceEvent: a16a2d60-4856-4914-8c0f-e3998e76f493: Column [Shipping_State] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: e0ea7ed3-a76d-4527-aebb-57a8439bd797
SourceEvent: e0ea7ed3-a76d-4527-aebb-57a8439bd797: Column [Shipping_Zip] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 5438f2a0-c4b5-47c4-ae81-1abdf1868345
SourceEvent: 5438f2a0-c4b5-47c4-ae81-1abdf1868345: Column [Shipping_Country] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: c580500a-0d9c-4fa0-abcd-c41a2fa6066e
SourceEvent: c580500a-0d9c-4fa0-abcd-c41a2fa6066e: Column [BuildingGeometryChildList] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: a5ca2d36-464b-44d3-b2c1-16eda57e7d6f
SourceEvent: a5ca2d36-464b-44d3-b2c1-16eda57e7d6f: Column [LineItemRecordChildList] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 5dc11970-b3a8-4ac3-a0f2-f09d3be31496
SourceEvent: 5dc11970-b3a8-4ac3-a0f2-f09d3be31496: Column [UniqHandle] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: d9e10c2b-29c4-40d5-a56f-8c8dbf526242
SourceEvent: d9e10c2b-29c4-40d5-a56f-8c8dbf526242: Column [CreatedDT] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: b47cbf68-1a37-4b85-8e7d-9931f8fffe07
SourceEvent: b47cbf68-1a37-4b85-8e7d-9931f8fffe07: Column [CreatedByUH] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 13fbabe5-01f4-41c7-baa0-47c2f08a6ff7
SourceEvent: 13fbabe5-01f4-41c7-baa0-47c2f08a6ff7: Column [LastModifiedDT] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 5e328254-b7f6-4c36-831c-474912858531
SourceEvent: 5e328254-b7f6-4c36-831c-474912858531: Column [LastModifiedByUH] was generated.
EventFired: ContentGrid: DataLoaded: 5f5b4049-a5d5-4e59-94ab-98cc898a4e51
SourceEvent: 5f5b4049-a5d5-4e59-94ab-98cc898a4e51: _reorderColumnsAfterDataLoad was set to false
SourceEvent: 5f5b4049-a5d5-4e59-94ab-98cc898a4e51: Processing [Name] column rule
SourceEvent: 5f5b4049-a5d5-4e59-94ab-98cc898a4e51: Moving column from 4 to 1
EventFired: ContentGrid: DataLoaded: b65f7e3d-e701-43d7-90e9-37a811d19de7
A first chance exception of type 'System.NullReferenceException' occurred in Telerik.Windows.Controls.GridView.dll
SourceEvent: 5f5b4049-a5d5-4e59-94ab-98cc898a4e51: Object reference not set to an instance of an object.
SourceEvent: 5f5b4049-a5d5-4e59-94ab-98cc898a4e51: EXCEPTION TERMINATION


[Successful Trace]

EventFired: ContentGrid: DataLoading: 1ff65262-3910-4509-a11e-b7cf00dbbab8
SourceEvent: 1ff65262-3910-4509-a11e-b7cf00dbbab8: _reorderColumnsAfterDataLoad was set to true
EventFired: ContentGrid: AutoGeneratingColumn: 04971e5d-46f1-43fd-973c-8f3a477b8c17
SourceEvent: 04971e5d-46f1-43fd-973c-8f3a477b8c17: Column [IsActive] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: dc51dd7b-a3d1-4e0f-a365-c86ec57f9c57
SourceEvent: dc51dd7b-a3d1-4e0f-a365-c86ec57f9c57: Column [ProjectUH] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 0ca97662-4c21-4c64-99d0-443e18b945a2
SourceEvent: 0ca97662-4c21-4c64-99d0-443e18b945a2: Column [Number] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: c759a1ff-6e0b-4ff4-8d54-733f6f795ab5
SourceEvent: c759a1ff-6e0b-4ff4-8d54-733f6f795ab5: Column [Name] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: b19222fd-9c78-4aa8-93d3-3cca9f3ea2ae
SourceEvent: b19222fd-9c78-4aa8-93d3-3cca9f3ea2ae: Column [UserCreatedDT] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 9ba48824-ea73-4b4b-842c-53781307b4f4
SourceEvent: 9ba48824-ea73-4b4b-842c-53781307b4f4: Column [Description] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 206a3725-4788-4d7e-afdc-7b82916167e1
SourceEvent: 206a3725-4788-4d7e-afdc-7b82916167e1: Column [Tax] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 4976a0e1-10c8-448c-b8d5-22818a733ec8
SourceEvent: 4976a0e1-10c8-448c-b8d5-22818a733ec8: Column [Multiplier] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 9f02178a-903a-4c31-b703-d1cea1450b9f
SourceEvent: 9f02178a-903a-4c31-b703-d1cea1450b9f: Column [Total] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 5b13dd4d-95ee-42f7-ba4d-245ddbdae1b3
SourceEvent: 5b13dd4d-95ee-42f7-ba4d-245ddbdae1b3: Column [Billing_Address1] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: a7cf8c48-e77d-4105-9fc5-9dacbf70117d
SourceEvent: a7cf8c48-e77d-4105-9fc5-9dacbf70117d: Column [Billing_Address2] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 8034612d-6361-46c9-be0e-1d53f9ca9d22
SourceEvent: 8034612d-6361-46c9-be0e-1d53f9ca9d22: Column [Billing_City] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 16be5efd-122a-43a0-bc83-f3fe5d300885
SourceEvent: 16be5efd-122a-43a0-bc83-f3fe5d300885: Column [Billing_State] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 7d7b7395-7dfa-4f2e-bb1b-cf45cc266cdd
SourceEvent: 7d7b7395-7dfa-4f2e-bb1b-cf45cc266cdd: Column [Billing_Zip] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 4954524c-ff7a-4748-8efa-7bbafd7be805
SourceEvent: 4954524c-ff7a-4748-8efa-7bbafd7be805: Column [Billing_Country] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 504885cd-d1cf-4043-8699-48596deea6eb
SourceEvent: 504885cd-d1cf-4043-8699-48596deea6eb: Column [Shipping_Address1] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 7d1c8b42-c2ab-4faf-a1ff-601a8ac74a95
SourceEvent: 7d1c8b42-c2ab-4faf-a1ff-601a8ac74a95: Column [Shipping_Address2] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: fc6e5f0c-449d-4d31-8c67-58da55c8071a
SourceEvent: fc6e5f0c-449d-4d31-8c67-58da55c8071a: Column [Shipping_City] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: d622adc7-70a3-496a-a13c-aad8398cf2a0
SourceEvent: d622adc7-70a3-496a-a13c-aad8398cf2a0: Column [Shipping_State] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: d367fbd3-3602-412e-a467-f10127d8e1d1
SourceEvent: d367fbd3-3602-412e-a467-f10127d8e1d1: Column [Shipping_Zip] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 0604c9ab-fb56-435e-b50d-25a8bb887c5c
SourceEvent: 0604c9ab-fb56-435e-b50d-25a8bb887c5c: Column [Shipping_Country] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 20c1b0cb-7d80-46b3-8bf6-4af8f63ad4ca
SourceEvent: 20c1b0cb-7d80-46b3-8bf6-4af8f63ad4ca: Column [BuildingGeometryChildList] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 32cdfe02-b323-4cee-a56c-54aab5085ea9
SourceEvent: 32cdfe02-b323-4cee-a56c-54aab5085ea9: Column [LineItemRecordChildList] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: ca102bb0-d2a7-4a55-9db8-9965f373fb8e
SourceEvent: ca102bb0-d2a7-4a55-9db8-9965f373fb8e: Column [UniqHandle] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: d35ca6ca-85c8-4709-89dc-48a839a11399
SourceEvent: d35ca6ca-85c8-4709-89dc-48a839a11399: Column [CreatedDT] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 07dd19c7-5c50-49c3-b60d-ecab4e99a183
SourceEvent: 07dd19c7-5c50-49c3-b60d-ecab4e99a183: Column [CreatedByUH] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: 5324d22c-5bcb-4c7c-b4d1-b6576f80815e
SourceEvent: 5324d22c-5bcb-4c7c-b4d1-b6576f80815e: Column [LastModifiedDT] was generated.
EventFired: ContentGrid: AutoGeneratingColumn: e8f085c5-d88f-49f7-a2af-e1e5119d4f3b
SourceEvent: e8f085c5-d88f-49f7-a2af-e1e5119d4f3b: Column [LastModifiedByUH] was generated.
EventFired: ContentGrid: DataLoaded: 1eb91145-1a83-459b-870d-79555367f53b
SourceEvent: 1eb91145-1a83-459b-870d-79555367f53b: _reorderColumnsAfterDataLoad was set to false
SourceEvent: 1eb91145-1a83-459b-870d-79555367f53b: Processing [Name] column rule
SourceEvent: 1eb91145-1a83-459b-870d-79555367f53b: Moving column from 4 to 1
EventFired: ContentGrid: DataLoaded: 47dcaf2b-6044-4b14-8f0a-875479f7be8c
SourceEvent: 1eb91145-1a83-459b-870d-79555367f53b: Moved column from 4 to 1
SourceEvent: 1eb91145-1a83-459b-870d-79555367f53b: Processing [Number] column rule
SourceEvent: 1eb91145-1a83-459b-870d-79555367f53b: Moving column from 4 to 2
EventFired: ContentGrid: DataLoaded: 2c18dac1-2231-488a-8774-d45f697ea168
SourceEvent: 1eb91145-1a83-459b-870d-79555367f53b: Moved column from 4 to 2
SourceEvent: 1eb91145-1a83-459b-870d-79555367f53b: Processing [Description] column rule
SourceEvent: 1eb91145-1a83-459b-870d-79555367f53b: Moving column from 6 to 3
EventFired: ContentGrid: DataLoaded: df5388b1-36f8-4605-b98b-f47ac63b7aea
SourceEvent: 1eb91145-1a83-459b-870d-79555367f53b: Moved column from 6 to 3

[Exception Details]
System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
  Source="Telerik.Windows.Controls.GridView"
  StackTrace:
       at Telerik.Windows.Controls.GridView.BaseVirtualizingPanel.ClearChildren()
       at Telerik.Windows.Controls.GridView.BaseVirtualizingPanel.ResetVisibleItems()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.OnColumnVisualPropertyChanged()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.ReorderColumns(Int32 oldIndex, Int32 newIndex)
       at Iti.Ccs.SharedControls.GridViewUserControl.ContentGrid_DataLoaded(Object sender, EventArgs e) in C:\Users\arodriguez\Documents\ITI.CCS\Trunk\Source\Iti.Ccs.SharedControls\GridViewUserControl.xaml.cs:line 1262
       at Telerik.Windows.Controls.GridView.GridViewDataControl.OnDataLoaded(EventArgs e)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.LoadData()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass4a.<Bind>b__49()
       at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.Bind(Object newValue)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.OnApplyTemplate()
       at Telerik.Windows.Controls.RadGridView.OnApplyTemplate()
       at System.Windows.FrameworkElement.ApplyTemplate()
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
       at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at Iti.Ccs.Shell.App.Main() in C:\Users\arodriguez\Documents\ITI.CCS\Trunk\Source\Iti.Ccs.Shell\obj\Debug\App.g.cs:line 0
       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()
  InnerException:

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 24 Sep 2009, 07:19 AM
Hi Agustin M Rodriguez,

Thank you for reporting this problem. We have added it to our bug-tracking system and we will fix the bug as soon as possible. You can try to execute the ReorderColumns method using the Dispatcher to eliminate the problem:

void gridView_DataLoaded(object sender, System.EventArgs e)  
{  
    if (flag)  
        return;  
 
    flag = true;  
    this.Dispatcher.BeginInvoke(new Action(() => this.gridView.ReorderColumns(0, 1)));  


All the best,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
answered on 28 Sep 2009, 04:35 PM
Milan,

Thank you for the suggestion, however although the code appears to execute correctly the columns are not being re-ordered.
0
Milan
Telerik team
answered on 29 Sep 2009, 07:31 AM
Hi Agustin M Rodriguez,

Well, it is difficult to tell what might be wrong without taking a look at your solution. Here is a sample application that reorders tha columns correctly.

Regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
Answers by
Milan
Telerik team
Agustin M Rodriguez, MCSD, MCPD
Top achievements
Rank 1
Share this question
or