Hello
I emphasize that the question is still unclear, but:
1. If data is bound from a database:
I prefer to have a Computed Column Specification in my Database Table.
2. If you have a method or event or ... for Update cells, compute sum in this block (After cells updated)
for example:
public void UpdateCells()
{
int sum = 0, myValue = 0;
foreach (TextBox t in myCellCollection)
{
if (int.TryParse(t.Text, out myValue))
sum += myValue;
}
SumText.Text = myValue.ToString();
}
You can also add all CellValues on passing them to
TextBox
es, then you don't need
TryParse(...
and
foreach(
I hope it will help.