Hi Experts,
The above picture shows a parent table and a child table in an Ultragrid. I want to get the total number of Purchase Orders in all jobs. (I.E) the above grid should show, the total number of Purchase Order(Count) = "4" (Summery Value)
How to do that?
Pls help me regarding this....
Thx
You would have to implement a sort've roll-up if you want to do this with summaries.
So what I would do is handle the InitializeLayout event of the grid. Add a Count summary to the child band. Add an unbound column to the root band - You can set this colmun's Hidden to true, if you like, so it's not visible to the user. Then you create a Sum summary for the parent band on the unbound column.
Then all you have to do is copy the value of the summary in the child band into the unbound cell in the parent row. So you would do this in InitializeRow. Trap for rows in the parent band, then get the SummaryValue from the child rows collection of that parent row:
e.Row.Cells["unbound column"].Value = e.Row.ChildBands[0].Rows.SummaryValues["my count summary"].Value
Thanks Mike, Not only the count, i want to display whatever Summary of the child table requested by the user. And pls tell me how to do filtering also to all the child rows..... Looking forward to ur reply.
Thx...
Abethan said:Not only the count, i want to display whatever Summary of the child table requested by the user.
I'm not sure what you are looking for here. There's nothing in the grid to automatically roll up summaries into the parent band. The grid could not possibly do this, since it can't make assumptions about the data structure. You will have to code it.
Abethan said:And pls tell me how to do filtering also to all the child rows
See the RowFilterMode property. I think that, by default, the filters only apply to the current rows collection, but you can make them apply to the entire band.