Hello
i'm trying to get the sum of column [Exit Units] in a repeater
with dataTable as datasource, i used to do like that in Page_Load:
- if (!IsPostBack)
- {
- DataTable dt = (DataTable)Session["CheckedRows"];
- Repeater1.DataSource = dt;
- Repeater1.DataBind();
- foreach (RepeaterItem item in Repeater1.Items)
- {
- if (item.ItemType == ListItemType.Item ||item.ItemType == ListItemType.Footer)
- {
- Label lblExitSum = (Label)item.FindControl("lblExitCount");
- string sum = dt.Compute("sum(ExitUni)", string.Empty).ToString();
- lblExitSum.Text = sum;
- }
- }
- }
but the output is strange and doesn't appeare in the footer after the last row like this:
Item No | Goods Description | UOM | Exit Units | Units New Balance | WT Balance | Exit WT | Exit Amount(LC) |
---|
S440862340A | C RAMP AW165 PAINT-S440862340A | ???? | 1 | 1.000000 | 0.365000 | 0.182500 | 146.797040 |
2 |
F1SEMIAUTO0441 | C.TO F1-L-16-M 220/240 50HZ MF C.CONT-F1SEMIAUTO0441 | ???? | 1 | 1.000000 | 1.160000 | 0.580000 | 1772.856560 |
|
the total of the column is 2 but it appears after the first row