using System; public class Test { public static void Main() { string Tvalue1 = "0"; string Tvalue2 = "0"; string Tvalue3 = "0"; for (int i = 0; i < 3; i++)//here 3 is gridview row length { string x = "1:1:1";//This your cell value int n = 3; string[] xxA = new string[n]; xxA[i] = x; //Here is the some logic's for the calculation and formating string[] Cx1 = xxA[i].Split(':'); Tvalue1 = (Convert.ToInt32(Tvalue1) + Convert.ToInt32(Cx1[0])).ToString(); Tvalue2 = (Convert.ToInt32(Tvalue2) + Convert.ToInt32(Cx1[1])).ToString(); Tvalue3 = (Convert.ToInt32(Tvalue3) + Convert.ToInt32(Cx1[2])).ToString(); } string FInalValue = Tvalue1 + ":" + Tvalue2 + ":" + Tvalue3; Console.Write(FInalValue); } }