如何使用vb.net在PrintingSystem中页面制动(DevExpress datagrid grouping Column Header)?

时间:2013-12-24 12:35:17

标签: datagrid devexpress grouping

如何使用vb.net在PrintingSystem中进行页面制动(DevExpress datagrid grouping Column Header)?

1 个答案:

答案 0 :(得分:1)

您可以使用GridView.BeforePrintRow / GridView.AfterPrintRow事件在打印每个分组行之前/之后插入分页符。
例如如下:

// C#
void gridView1_BeforePrintRow(object sender, DevExpress.XtraGrid.Views.Printing.PrintRowEventArgs e) {
    if(gridView1.IsGroupRow(e.RowHandle))
        e.PS.InsertPageBreak(e.Y);
}

// VB.NET
Private Sub gridView1_BeforePrintRow(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Printing.PrintRowEventArgs) Handles GridView1.BeforePrintRow
    If gridView1.IsGroupRow(e.RowHandle) Then
        e.PS.InsertPageBreak(e.Y)
    End If
End Sub