Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

DataGridView Join

$
0
0

Hi Experts,

I have Two DataGridViews dgvGrns, dgvOABomExplosion

dgvgrns have tow important columns rawitemno and linkedqty

dgvGrns datagridview contains Records of Grns  and in few grns there are linedqty which are non zero , i want the sum of this linkedqty on rawitemno which i can get using following code

 var result = from row in dgvGrns.Rows.OfType<DataGridViewRow>()
                      group row by new { rawitemno = row.Cells["rawitemno"].Value} into grp
                      select new { rawitemno = grp.Key.rawitemno ,
                                   linkedqty = grp.Sum(p => Convert.ToDecimal(p.Cells["linkedqty"].Value))
                      };

now what i want is that this result  OF LINQ QUERY BE joined to DataGridview dgvOABomExplosion on

result.itemno = dgvOABomExplosion.Cells["RawItemNo"] 

where result.linkedqty != dgvOABomExplosion.Cells["RawQty"] 

can you please help me write a suitable Linq Query


Viewing all articles
Browse latest Browse all 2535

Trending Articles