Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
Getting Summary value for the child table
posted

 

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

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    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

     

     

     

Children