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
Post a Comment