Current filter:
                                You should refresh the page.
                                  • System.Reflection.TargetInvocationException
                                      Message=Exception has been thrown by the target of an invocation.
                                       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
                                       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
                                       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.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
                                       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
                                       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 DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
                                       at DevExpress.XtraGrid.GridControl.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(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 System.Windows.Forms.Application.Run(Form mainForm)
                                       at OrderSummary.Program.Main() in D:\WindowsApplication\WINDOWS APPLICATIONS\OS\Program.cs:line 28

                                    Inner Exception 1:
                                    InvalidOperationException: A multithreading issue is detected. The DevExpress.Data.CurrencyDataController.DisableThreadingProblemsDetection option allows you to disable the exception, but it does not resolve the underlying issue.
                                    ManagedThreadId: 5; ThreadName: ''
                                       at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
                                       at System.Environment.get_StackTrace()
                                       at DevExpress.Data.BaseGridController.ThrowCrossThreadExceptionToTheUIThreadIfPossible()
                                       at DevExpress.Data.BaseGridController.CheckCrossThread(Action`1 method, Boolean ignoreThreadWarning)
                                       at DevExpress.Data.CurrencyDataController.RaiseOnBindingListChanged(ListChangedEventArgs e)
                                       at DevExpress.Data.Helpers.ListDataControllerHelper.OnBindingListChanged(ListChangedEventArgs e)
                                       at DevExpress.Data.DataControllerBase.OnBindingListChanged(Object sender, ListChangedEventArgs e)
                                       at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
                                       at DevExpress.Data.Helpers.VirtualServerModeCore.RaiseListChanged(ListChangedEventArgs e)
                                       at DevExpress.Data.Helpers.VirtualServerModeCore.BindingListListChanged(Object sender, ListChangedEventArgs e)
                                       at System.Data.DataView.OnListChanged(ListChangedEventArgs e)
                                       at System.Data.DataView.IndexListChanged(Object sender, ListChangedEventArgs e)
                                       at System.Data.DataView.IndexListChangedInternal(ListChangedEventArgs e)
                                       at System.Data.DataViewListener.IndexListChanged(ListChangedEventArgs e)
                                       at System.Data.Index.<>c.<OnListChanged>b__88_0(DataViewListener listener, ListChangedEventArgs args, Boolean arg2, Boolean arg3)
                                       at System.Data.Listeners`1.Notify[T1,T2,T3](T1 arg1, T2 arg2, T3 arg3, Action`4 action)
                                       at System.Data.Index.OnListChanged(ListChangedEventArgs e)
                                       at System.Data.Index.OnListChanged(ListChangedType changedType, Int32 index)
                                       at System.Data.Index.InsertRecord(Int32 record, Boolean fireEvent)
                                       at System.Data.Index.ApplyChangeAction(Int32 record, Int32 action, Int32 changeRecord)
                                       at System.Data.Index.RecordStateChanged(Int32 record, DataViewRowState oldState, DataViewRowState newState)
                                       at System.Data.DataTable.RecordStateChanged(Int32 record1, DataViewRowState oldState1, DataViewRowState newState1, Int32 record2, DataViewRowState oldState2, DataViewRowState newState2)
                                       at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Boolean suppressEnsurePropertyChanged, Int32 position, Boolean fireEvent, Exception& deferredException)
                                       at System.Data.DataTable.InsertRow(DataRow row, Int64 proposedID, Int32 pos, Boolean fireEvent)
                                       at System.Data.DataRowCollection.Add(Object[] values)
                                       at System.Data.DataTable.UpdatingAdd(Object[] values)
                                       at System.Data.DataTable.LoadDataRow(Object[] values, Boolean fAcceptChanges)
                                       at System.Data.ProviderBase.SchemaMapping.LoadDataRow()
                                       at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
                                       at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
                                       at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
                                       at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
                                       at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
                                       at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
                                       at OrderSummary.frmOrderSummary.GetDataFromStartToEnd(Int32 start, Int32 end, String& query_input) in D:\WindowsApplication\WINDOWS APPLICATIONS\OS\frmOrderSummary.cs:line 1167
                                       at OrderSummary.frmOrderSummary.<>c__DisplayClass58_0.<virtualServerModeSource1_MoreRows>b__0() in D:\WindowsApplication\WINDOWS APPLICATIONS\OS\frmOrderSummary.cs:line 1139
                                       at System.Threading.Tasks.Task`1.InnerInvoke()
                                       at System.Threading.Tasks.Task.Execute()
                                       at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
                                       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
                                       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
                                       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
                                       at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
                                       at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
                                       at System.Threading.ThreadPoolWorkQueue.Dispatch()
                                       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

                                Show all comments
                                • Sasha (DevExpress Support) 09.12.2019

                                  Hello Milind,
                                  Thank you for the call stack and code. I've prepared a small sample using your code, however, the issue is not reproducible. Please find it in the attachment. It seems that I am missing some important details or steps. Also, I see that an exception is raised due to an incorrect cross-thread operation. Taking all this into account, is it possible to modify the attached sample in order to reproduce the issue? Also, please collect the call stack of all threads when the issue occurs. For this, run your project in Debug mode and open the Debug->Windows->Threads window.

                                  In addition, please clarify whether the Grid is bound to your dt table or to your VirtualServerModeSource.
                                  I look forward to your results.

                                • Milind Wadge 1 09.15.2019

                                  Hi Sasha,
                                   Thank you for your prompt response.
                                     But i  have one more issue as per your solution if we fill datatable it will take lot of time to fill datatable from database also sorting and filtering not work. it will call morerows again.
                                   attached file with updated code that work for add rows in batches but not for filtering and sorting please help me on that.
                                  Thank you in advance

                                • Sasha (DevExpress Support) 09.16.2019

                                  Hello Milind,
                                  Thank you for the modified sample project. When the Grid is bound to VirtualServerModeSource, sorting and filtering should be manually implemented at the data level. This data source supports a special event to filter/sort data: ConfigurationChanged. Please use this event to complete your task.
                                  I also recommend that you review the example implementation in our demo: Infinite Scrolling module in the XtraGrid MainDemo. The complete source code is available in the VirtualServerMode.cs file of our Data Grid and Editors Demo located in the %PUBLIC%\Documents\DevExpress Demos 19.1\Components\WinForms\CS\GridMainDemo folder.

                                  But i  have one more issue as per your solution if we fill datatable it will take lot of time to fill datatable from database

                                  Do you mean the table that you are using in the virtualServerModeSource1_AcquireInnerList event? If so, it's not necessary to populate it; it's enough to create only the required columns. I've slightly modified the sample to illustrate this. New rows should be provided by using the MoreRows event.
                                  Should you have further questions, let me know.

                                • Sasha (DevExpress Support) 09.18.2019

                                  Did you use the implementation from our demo? If so, would you please modify my sample in order to illustrate the issue?

                                • Milind Wadge 1 09.19.2019

                                  Yes, As per implementation demo it will take more time to fill data in datatable or dataset.

                                • Sasha (DevExpress Support) 09.20.2019

                                  Hello Milind,
                                  Thank you for the clarification. I need additional time to reproduce the issue and will update this thread as soon as possible.

                                • Sasha (DevExpress Support) 10.01.2019

                                  Hello Milind,

                                  Thank you very much for your patience. I've finished working on a solution and attached a sample project that illustrates how you can use the ConfigurationChanged event to sort the Grid. I use the ServerModeGridProjects database that you can generate in the Instant Feedback UI module of our Data Grid and Editors demo. For you convenience, I've attached it to my comment.

                                  Please let me know if this approach is helpful.

                                0 Solutions

                                Creation Date Importance Sort by