Unplanned
Last Updated: 12 Nov 2019 14:59 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 03 Jul 2018 13:10
Category: UI Framework
Type: Bug Report
1
FIX. RadListSource - when a lot of update operations are called from different threads, it is possible to end up in a deadlock
To reproduce: please run the application provided in the ticket. You will notice that RadGridView stops updating.

Workaround: use MethodInvoker for the update operation:

        private void readTicks()
        {
            DateTime now = DateTime.Now;
            Tick previouse = null;
            for (int i = 0; i < lines.Length; i++)
            {
                if (canceled)
                    return;

                var t = new Tick();

                try
                {
                    try
                    {
                        JsonConvert.PopulateObject(lines[i], t);
                    }
                    catch
                    {
                        continue;
                    }


                    var c = contracts[t.ContractId];
                    c.Row[(int)t.TickType] = t;
                    c.CurrentTickSetNr++;

                    if (this.radGridView1.InvokeRequired)
                    {
                        this.radGridView1.Invoke(new MethodInvoker(delegate { c.Fire(t); }));
                    }
                    else
                    {
                        c.Fire(t);
                    }

                    previouse = t;
                    OnTick?.Invoke(c.ConId, i);
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e.Message);
                }
            }

            OnDone?.Invoke(this, new EventArgs());
        }
0 comments