Hi
I have 3 fields in a repeater Id,Received,Issued.
In another column i want to display Value as Received-Issued. In the end of repeater i want to display Total like below
Id Received Issued Balance
1 10 4 6
2 5 2 3
Total 15 6 9
Thanks
Hi
I have 3 fields in a repeater Id,Received,Issued.
In another column i want to display Value as Received-Issued. In the end of repeater i want to display Total like below
Id Received Issued Balance
1 10 4 6
2 5 2 3
Total 15 6 9
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jignesh KumarRank #91 · 22.9K reputationPosted Oct 16, 2022, 11:49 PM EDT
Hi Ramco,
You can use ItemDataBound event to calculate sum in another column and footer,
int total = 0; protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { //using findcontrol method the label and get the Recieved and issued sum int sumOfTwocolumn = Convert.ToInt32(((Label)e.Item.FindControl("lblRecieved")).Text) - Convert.ToInt32(((Label)e.Item.FindControl("lblissued")).Text); //Set Values to another column Label ((Label)e.Item.FindControl("lblNewLableFoSum")).Text = Convert.ToString(sumOfTwocolumn); if (e.Item.ItemType == ListItemType.Footer) { Label lbl = (Label)e.Item.FindControl("Label1"); lbl.Text = total.toString(); //set value in footer } }