GrapeCity MultiRow Windows Forms Documentation
MultiColumnsPrintOrder Property
Example 


Gets or sets a value that indicates how to print the sections when PagingMode is PagingMode.MultiColumns mode.
Syntax
<DefaultValueAttribute()>
<SuppressMessageAttribute(Category="Microsoft.Naming", 
   CheckId="CA1704:IdentifiersShouldBeSpelledCorrectly", 
   Scope="", 
   Target="", 
   MessageId="Multi", 
   Justification="")>
<RefreshPropertiesAttribute(RefreshProperties.Repaint)>
<SRDescriptionAttribute("Indicates how to print Rows in MultiColumns mode.")>
Public Property MultiColumnsPrintOrder As PrintOrder
Dim instance As PrintSettings
Dim value As PrintOrder
 
instance.MultiColumnsPrintOrder = value
 
value = instance.MultiColumnsPrintOrder
[DefaultValue()]
[SuppressMessage(Category="Microsoft.Naming", 
   CheckId="CA1704:IdentifiersShouldBeSpelledCorrectly", 
   Scope="", 
   Target="", 
   MessageId="Multi", 
   Justification="")]
[RefreshProperties(RefreshProperties.Repaint)]
[SRDescription("Indicates how to print Rows in MultiColumns mode.")]
public PrintOrder MultiColumnsPrintOrder {get; set;}

Property Value

One of the PrintOrder values. The default is PrintOrder.DownThenOver.
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionThe specified value is not one of the PrintOrder values.
Remarks
You can determine how to put all sections in a page by setting PagingMode to PagingMode.MultiColumns. If you select PrintOrder.OverThenDown on a page, all the Sections are ordered from the page's left to the right. Once one row of the current page is full, the residual Sections are printed starting from the next row's far left to the right until this row is full. If you select PrintOrder.DownThenOver, on a page, all the Sections are layed out from the page's top to the bottom. Once one column in the current page is full, the residual Sections are printed starting from the next column's far top to the bottom until this column is full.
Example
The following code example shows how to use the PrintStyle.Content style and the PagingMode.MultiColumns option to print the GcMultiRow control. The MultiColumnsPrintOrder property sets all the rows printing order in PagingMode.MultiColumns mode. This example is part of a larger example available for the GcMultiRow.PrintSettings class.
void setContentAndMultiColumnButton_Click(object sender, EventArgs e)
        {
            Template template1 = CreateTemplate(1, 21);
            AddPrintInfoCellColumnFooterSection(template1, 21);
            this.gcMultiRow1.Template = template1;
            gcMultiRow1.RowCount = 81;

            //Only the content(Text,Image) is printed, the backgound, border is not printed.
            gcMultiRow1.PrintSettings.PrintStyle = PrintStyle.Content;
            gcMultiRow1.PrintSettings.AutoFitWidth = false;
            //Only one Row is printed to one page. You can print ColumnHeader to each page by setting PrintHeader property to AllPages.
            gcMultiRow1.PrintSettings.PagingMode = PagingMode.MultiColumns;
            //All Columns in each page are aligned by MiddleCenter.
            gcMultiRow1.PrintSettings.Alignment = MultiRowContentAlignment.MiddleCenter;
            //All Rows are printed.
            gcMultiRow1.PrintSettings.PrintRange = MultiRowPrintRange.AllRows;
            //In MultiColumns mode, on each Column's head, the ColumnHeader is filled. If you set this to FirstPage, only first Column exists one ColumnHeader.
            gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages;
            //Between each Column in page, there are 15 pixels.
            gcMultiRow1.PrintSettings.ColumnMargin = 15;

            if (flag)
            {
                gcMultiRow1.PrintSettings.MultiColumnsPrintOrder = PrintOrder.OverThenDown;
                flag = false;
            }
            else
            {
                gcMultiRow1.PrintSettings.MultiColumnsPrintOrder = PrintOrder.DownThenOver;
                flag = true;
            }
            gcMultiRow1.PrintSettings.ZoomFactor = 1f;
            try
            {
                gcMultiRow1.PrintPreview();
                //If you have a printer, you can execute the following code directly instead.
                //gcMultiRow1.Print(true);
            }
            catch (Exception ex)
            {
                // Can't find printer driver.
                MessageBox.Show(ex.Message);
            }
            label.Text = "In Content style, only the Text and Image are printed; In MultiColumns mode, the MultiColumnsPrintOrder controls all Rows printing order; The ColumnMargin property sets 15 pixels between each column;(Click this button again, the MultiColumnsPrintOrder changes to another effect.)";
        }
Private Sub setContentAndMultiColumnButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setContentAndMultiColumnButton.Click
        Dim template1 As Template = CreateTemplate(1, 21)
        AddPrintInfoCellColumnFooterSection(template1, 21)
        Me.gcMultiRow1.Template = template1
        gcMultiRow1.RowCount = 81

        'Only the content(Text,Image) is printed, the backgound, border is not printed.
        gcMultiRow1.PrintSettings.PrintStyle = PrintStyle.Content
        gcMultiRow1.PrintSettings.AutoFitWidth = False
        'Only one Row is printed to one page. You can print ColumnHeader to each page by setting PrintHeader property to AllPages.
        gcMultiRow1.PrintSettings.PagingMode = PagingMode.MultiColumns
        'All Columns in each page are aligned by MiddleCenter.
        gcMultiRow1.PrintSettings.Alignment = MultiRowContentAlignment.MiddleCenter
        'All Rows are printed.
        gcMultiRow1.PrintSettings.PrintRange = MultiRowPrintRange.AllRows
        'In MultiColumns mode, on each Column's head, the ColumnHeader is filled. If you set this to FirstPage, only first Column exists one ColumnHeader.
        gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages
        'Between each Column in page, there are 15 pixels.
        gcMultiRow1.PrintSettings.ColumnMargin = 15

        If flag Then
            gcMultiRow1.PrintSettings.MultiColumnsPrintOrder = PrintOrder.OverThenDown
            flag = False
        Else
            gcMultiRow1.PrintSettings.MultiColumnsPrintOrder = PrintOrder.DownThenOver
            flag = True
        End If
        gcMultiRow1.PrintSettings.ZoomFactor = 1.0F
        Try
            'If you have a printer, you can execute the following code directly instead.
            'gcMultiRow1.Print(true);
            gcMultiRow1.PrintPreview()
        Catch ex As Exception
            ' Can't find printer driver.
            MessageBox.Show(ex.Message)
        End Try
        label.Text = "In Content style, only the Text and Image are printed; In MultiColumns mode, the MultiColumnsPrintOrder controls all Rows printing order; The ColumnMargin property sets 15 pixels between each column;(Click this button again, the MultiColumnsPrintOrder changes to another effect.)"
    End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

PrintSettings Class
PrintSettings Members
PagingMode Property
Section Class

 

 


Copyright © GrapeCity, inc. All rights reserved.