Please refer below sample.
HTML
<div>
<asp:Repeater ID="rptrMaintenance" runat="server" OnItemDataBound="rptrMaintenance_DataBinding">
<HeaderTemplate>
<table cellpadding="0" cellspacing="0" valign="top">
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Id" Font-Bold="false" Font-Size="11px"></asp:Label>
</td>
<td>
<asp:Label ID="lblCost" runat="server" Text="Cost" Font-Bold="false" Font-Size="11px"></asp:Label>
</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label ID="lblNum" runat="server" Text='<%#Eval("Id") %>' />
</td>
<td>
<asp:Label ID="lblCost" runat="server" Text='<%#Eval("Cost") %>' />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
<tr>
<td>
Amount
</td>
<td>
<asp:Label ID="lblTotCost" runat="server" />
</td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
private float totalCost;
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Cost", typeof(float));
dt.Rows.Add(1, 100.25);
dt.Rows.Add(2, 105.24);
dt.Rows.Add(3, 185.89);
totalCost = 391.38F; //Get this from Database.
rptrMaintenance.DataSource = dt;
rptrMaintenance.DataBind();
}
}
protected void rptrMaintenance_DataBinding(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Footer)
{
((Label)e.Item.FindControl("lblTotCost")).Text = totalCost.ToString();
}
// Or simply you can below code to get total without database.
//float total = 0;
//if (e.Item.ItemType == ListItemType.Item)
//{
// int cost = Convert.ToInt32(((Label)e.Item.FindControl("lblCost")).Text);
// total += cost;
//}
//if (e.Item.ItemType == ListItemType.Footer)
//{
// ((Label)e.Item.FindControl("lblTotCost")).Text = total.ToString();
//}
}
Screenshot