c# - Populate multiple Datagridviews with streaming data -


i have being battling problem quite few days. seems every single example have seen relies on present data. in case have stream processed , splitted number of string arrays , these populate dgvs. (working) solution this

public void addrowstodgvs() {       (int = 0; < dtblrepository.length; i++)     {         if (dgvrepository[i].invokerequired)         {             dgvrepository[i].invoke(new methodinvoker(delegate             {                 foreach (string[] datao in datatoadd.getconsumingenumerable())                 {                     int indexofdgv = array.indexof(activedatas, datao[0]);                     dgvrepository[indexofdgv].rows.insert(0, datao);                     dgvrepository[indexofdgv].refresh();                     application.doevents();                 }             }));         }         else         application.doevents();                        } } 

some explaining :

  • dtblrepository array of datatables (for time being provides index later maybe dump it
  • dgvrepository array holding dgvs
  • datatoadd blockingcollection populated routine
  • activedatas array holding elements stream processed , yes code depends on application.doevents() whole code runs this: trd = new thread(addrowstodgvs); trd.start()

eveyone seems point async/await can't find sample fits needs....can :)


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -