hi Admin
i have data in ultragrid populated from excel
i want to calulate sum of each and every row that value can show in that row last column
if already solution posted for that pl refer me the link
Thanks & Regards
Karthik
Hirotec India ltd
UltraGridBand exposes a Summaries collection property which contains a member for each column in the band. You can add members to this collection to get summary rows to appear in the grid; where they appear can also be controlled, as demonstrated by the code sample in the link I posted.
u have mentioned example no, its calulating only colum total.
my need is , i m havind data in datacolum like [student name],[ mark1],[mark2],[total] ,
so results would be Peterson ,90 , 90 , 180
hope u got my point now
Regards
Hi,
You could do this in a couple of ways.
One way would be to use the InitalizeRow event. The event fires for each row when it is created and also any time a value in any cell of the row changes. So you can set the value on a cell in the row based on the values of the other cells in the same row and the InitializeRow event it ideally suited for that.
Another option is to use UltraCalcManager and apply a Formula to your totals column. In this case, the formula would be something like:
[mark1] + [mark2]
Thanks ! Mike ,
In u r First method cant possible in my case becasue i m just assigning values to the datatable . whis is having acting Datasource for Ultragrid
U r second option s pretty good but it fails if the column name have any operator in that
Like [Pass / Fail] , Its replied the Error #Ref in Resultant column.
But i have done it by calulating total by that tme itself by assiging local variable addtion in that current inner loop
HirotecIndia
Thanks Mike , Its Worki Gr8
Hi HirotecIndia,
karthi2itnet said:In u r First method cant possible in my case becasue i m just assigning values to the datatable . whis is having acting Datasource for Ultragrid
I don't see why that would matter. If you change a value in a row in your DataTable, then InitializeRow event of the grid will fire for that row.
karthi2itnet said: U r second option s pretty good but it fails if the column name have any operator in that Like [Pass / Fail] , Its replied the Error #Ref in Resultant column.
You have to use an escape code to put special characters into a formula. In this case, I think you would just do this:
[Pass // Fail]