Hi I have a problem. I have used code to alter each groupbyrow description and summaryfootercaption.
None of these changes are honoured when my grid is printed(uses default text). Can anyone help me?
Code used to change each GroupByRow summaryfootercaption:
For Each gRow As UltraGridGroupByRow In Me.MyGrid.Rows
Next
Code used to change each GroupByRow description
gRow.Description = gRow.Rows(0).Cells(6).Value
Hi Geir,
When the grid prints, it creates a clone of the layout and the rows are re-created. So your code here is applying to the rows of the grid on-screen, but you are not calling the same code on the print rows.
What you should do is using the InitializeGroupByRow event instead of looping through the rows. This is more efficient than looping, and the event will get fired for both the on-screen grid rows and the print rows.
Thanks a lot Mike. You saved my day. I ended up using this code in the InitializeGroupByRow event :
If e.Row.Index <> datSummaryCaption.Rows.Count Then
e.Row.Description = e.Row.Rows(0).Cells(6).Text
e.Row.Rows.SummaryValues.SummaryFooterCaption = datSummaryCaption.Rows(groupByRowIndex).Item(1).ToString
groupByRowIndex += 1
End If
If e.Row.Index = datSummaryCaption.Rows.Count - 1 Then
groupByRowIndex = 0