I have a gridview with property autogeneratecolumn=true
and my DataTable is filling the data as mentioned below using mdx query.
sales2015 sales2014
1256 1235
3569 0
0 1235
i want to add another column named "VARIENT" and need to show the percentages in the same.
Formula:
(sales2015 - sales2014)/sales2015 * 100
Need to calulate each row for the datatable using same formula and bind to gridview.
please help me with the logic.
Note : my grid is having autogenerated columns
expected result is like this
sales2015 sales2014 Varient
1256 1235 **%
3569 0 **%
0 1235 **%
My Code part is:
System.Data.DataTable dt = new System.Data.DataTable();
ViewData1 vData = new ViewData1();
dt = vData .__getCustomerSource()// Here in this function i was filling the datatable and returing
DataGrid1.DataSource = null;
DataGrid1.DataSource = dt;
DataGrid1.DataBind();