0
The answer is relatively easy with LINQ
:
var linhas = myDataGridView.Rows.Cast<DataGridViewRow>().Select(r => Convert.ToString(r.Cells["mensagem"].Value));
double somaLinhas = linhas.Sum(r => r.Length * 0.02);
lblSoma.Text = string.Format(@"{0:#,##0.00}", somaLinhas);
The name of the column mensagem
must be amended if that name is not effective, and Label
lblSoma
and the myDataGridView
.
If we are on [pt.so], why not ask in Portuguese yourself?
– Woss