GrapeCity.Win.MultiRow Namespace > ColumnFooterSection Class : Printable Property |
<SRDescriptionAttribute("Indicates whether the ColumnFooterSection is printable.")> <SRCategoryAttribute("Behavior")> <BrowsableAttribute(True)> <EditorBrowsableAttribute()> Public Overrides Property Printable As Boolean
Dim instance As ColumnFooterSection Dim value As Boolean instance.Printable = value value = instance.Printable
[SRDescription("Indicates whether the ColumnFooterSection is printable.")] [SRCategory("Behavior")] [Browsable(true)] [EditorBrowsable()] public override bool Printable {get; set;}
void setPrintableButton_Click(object sender, EventArgs e) { Template template = Template.Default; Section displayHeaderSection = template.ColumnHeaders[0]; ColumnHeaderSection printHeaderSection = new ColumnHeaderSection(); printHeaderSection.Height = 40; // Initialize and add a PrintInfoCell into printHeaderSection. PrintInfoCell printInfoCell = new PrintInfoCell(); printInfoCell.FormatString = "{PageNumber} of {PageCount}"; printInfoCell.Size = new Size(template.Width, printHeaderSection.Height); printHeaderSection.Cells.Add(printInfoCell); template.ColumnHeaders.Add(printHeaderSection); // The section used for screen displayn. displayHeaderSection.Printable = false; displayHeaderSection.Visible = true; // The section used to display when printing. printHeaderSection.Visible = false; printHeaderSection.Printable = true; // Reload template this.gcMultiRow1.Template = template; this.gcMultiRow1.RowCount = 100; // Print column header in every page. this.gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages; try { this.gcMultiRow1.PrintPreview(); } catch(Exception ex) { // Can't find printer. MessageBox.Show(ex.Message); } }
Private Sub setPrintableButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setPrintableButton.Click Dim template1 As Template = Template.Default Dim displayHeaderSection As Section = template1.ColumnHeaders(0) Dim printHeaderSection As New ColumnHeaderSection() printHeaderSection.Height = 40 ' Initialize and add a PrintInfoCell into printHeaderSection. Dim printInfoCell As New PrintInfoCell() printInfoCell.FormatString = "{PageNumber} of {PageCount}" printInfoCell.Size = New Size(template1.Width, printHeaderSection.Height) printHeaderSection.Cells.Add(printInfoCell) template1.ColumnHeaders.Add(printHeaderSection) ' The section uses for screen display. displayHeaderSection.Printable = False displayHeaderSection.Visible = True ' The section used to display when printing. printHeaderSection.Visible = False printHeaderSection.Printable = True ' Reload template Me.gcMultiRow1.Template = template1 Me.gcMultiRow1.RowCount = 100 ' Print column header in every page. Me.gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages Try Me.gcMultiRow1.PrintPreview() Catch ex As Exception ' Can't find printer. MessageBox.Show(ex.Message) End Try End Sub
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