Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7794595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:49:14+00:00 2026-06-01T22:49:14+00:00

I have a DevExpress GridControl bound to a BindingList. I tried to modify the

  • 0

I have a DevExpress GridControl bound to a BindingList.

I tried to modify the BindingList from a thread and this threw an exception, I googled it and found the following explanation:

This issue is not connected with the XtraGrid directly. Unfortunately, you can’t change the grid’s data source in a background thread since it will cause a lot of problems with synchronization. The XtraGrid may perform some operations with the underlying data source at the same time as your background thread changes it. In this case the grid may receive a Change notification later and will try to update rows from the data source which will cause the mentioned problem. This problem may occur in a lot of cases. For example, when a user edits data, groups it or the XtraGrid tries to recalculate the summaries. The only solution to this problem is to change the Grid’s DataSource reference within a background thread (NOTE: You will need to implement it using the Invoke method). Said differently, within a background thread you should work with a local copy of the DataSource and pass its clone to the Grid’s DataSource when necessary. In the attached example you will find a sample project which demonstrates this approach.

I tried what it said, resulting in this:

proxyWorker = new Thread(() =>
{
    //Clone the datasource into the thread
    BindingList<Proxy> newList = new BindingList<Proxy>(proxies);

    //Set the proxy source to the cloned datasource in the thread
    gcProxies.BeginInvoke(new MethodInvoker(delegate { gcProxies.DataSource = newList; }));

   //Logic here
});

proxyWorker.Name = "proxyTester";

proxyWorker.Start();

It works, but what I don’t understand is what happens to the datasource after the thread ends? Isn’t newList destroyed?

What I was thinking is that at the end I would reclone newList and set it back into proxies (the original datasource)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:49:16+00:00Added an answer on June 1, 2026 at 10:49 pm

    I think your confusion stems from the fact that you think a .NET object is associated with the thread that created it. That is not the case, all threads in a process share the same GC heap. A List<> object created in one thread isn’t different from a List<> in another, it doesn’t in any way keep the thread that created it alive.

    What is an issue with threading is that there are a lot of classes that are not thread-safe. This is certainly the case for any UI component. What you can’t do is assign a property of such a class object from another thread while that property value may also be used in the UI thread. Almost all of the properties of a UI component have that restriction. Data binding is particularly troublesome since the property assignments are not directly visible. You only set the DataSource, not all the other properties that the binding sets. Using Control.BeginInvoke or Dispatcher.BeginInvoke ensures that the property values are set in the same thread that created the control, thus solving the thread safety problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DevExpress GridControl bound to a BindingList. I used a BindingList so
Here is my scenarion: I have a GridControl bound to a BindingList. At first
I have a DevExpress GridControl and i want each cell to be multiline. I
I have a DevExpress VCL ribbon in my Delphi app From time to time
Scenario I have a DevExpress DataGrid which is bound to a DataSet in C#.
I have a grid (DevExpress XtraGrid, if that matters) which is bound to a
I have AspxTabPageControl.. of Devexpress I want to get the active tab index from
I am using DevExpress GridControl to display information from my database through a stored
I currently have the following XAML for my Grid control: <dxg:GridControl x:Name=DXGrid> <dxg:GridControl.Columns> <dxg:Column
VB .NET 4 WinForms application. I have a (DevExpress) grid bound to an IEnumerable(Of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.