menu

Document Processing

PdfGridRowStyle Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfGridRowStyle Class

    Provides customization of the appearance for the PdfGridRow

    Inheritance
    System.Object
    PdfGridStyleBase
    PdfGridRowStyle
    PdfGridCellStyle
    Implements
    System.ICloneable
    Inherited Members
    PdfGridStyleBase.BackgroundBrush
    PdfGridStyleBase.Clone()
    PdfGridStyleBase.Font
    PdfGridStyleBase.TextBrush
    PdfGridStyleBase.TextPen
    Namespace: Syncfusion.Pdf.Grid
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfGridRowStyle : PdfGridStyleBase, ICloneable
    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page.
    PdfPage page = doc.Pages.Add();
    //Create a PdfGrid.
    PdfGrid pdfGrid = new PdfGrid();
    //Create a DataTable.
    DataTable dataTable = new DataTable();
    //Add columns to the DataTable
    dataTable.Columns.Add("ID");
    dataTable.Columns.Add("Name");
    //Add rows to the DataTable.
    dataTable.Rows.Add(new object[] { "E01", "Clay" });
    dataTable.Rows.Add(new object[] { "E02", "Thomas" });
    //Assign data source.
    pdfGrid.DataSource = dataTable;
    //Using the Column collection
    pdfGrid.Columns[0].Width = 100;
    //Adding grid row style
    PdfGridRowStyle rowStyle = new PdfGridRowStyle();
    //Setting text pen for row
    rowStyle.TextBrush = PdfBrushes.Blue;
    //Applying style to grid
    pdfGrid.Rows[0].Style = rowStyle;
    //Draw grid to the page of PDF document.
    pdfGrid.Draw(page, new PointF(10, 10));
    //Save the document.
    doc.Save("Output.pdf");
    //close the document
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a PdfGrid.
    Dim pdfGrid As New PdfGrid()
    'Create a DataTable.
    Dim dataTable As New DataTable()
    'Add columns to the DataTable
    dataTable.Columns.Add("ID")
    dataTable.Columns.Add("Name")
    'Add rows to the DataTable.
    dataTable.Rows.Add(New Object() {"E01", "Clay"})
    dataTable.Rows.Add(New Object() {"E02", "Thomas"})
    'Assign data source.
    pdfGrid.DataSource = dataTable
    'Using the Column collection
    pdfGrid.Columns(0).Width = 100
    'Adding grid row style
    Dim rowStyle As New PdfGridRowStyle()
    'Setting text pen for row
    rowStyle.TextBrush = PdfBrushes.Blue
    'Applying style to grid
    pdfGrid.Rows(0).Style = rowStyle
    'Draw grid to the page of PDF document.
    pdfGrid.Draw(page, New PointF(10, 10))
    'Save the document.
    doc.Save("Output.pdf")
    'close the document
    doc.Close(True)

    Constructors

    PdfGridRowStyle()

    Initializes a new instance of the PdfGridRowStyle class.

    Declaration
    public PdfGridRowStyle()
    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page.
    PdfPage page = doc.Pages.Add();
    //Create a PdfGrid.
    PdfGrid pdfGrid = new PdfGrid();
    //Create a DataTable.
    DataTable dataTable = new DataTable();
    //Add columns to the DataTable
    dataTable.Columns.Add("ID");
    dataTable.Columns.Add("Name");
    //Add rows to the DataTable.
    dataTable.Rows.Add(new object[] { "E01", "Clay" });
    dataTable.Rows.Add(new object[] { "E02", "Thomas" });
    //Assign data source.
    pdfGrid.DataSource = dataTable;
    //Using the Column collection
    pdfGrid.Columns[0].Width = 100;
    //Adding grid row style
    PdfGridRowStyle rowStyle = new PdfGridRowStyle();
    //Setting text pen for row
    rowStyle.TextBrush = PdfBrushes.Blue;
    //Applying style to grid
    pdfGrid.Rows[0].Style = rowStyle;
    //Draw grid to the page of PDF document.
    pdfGrid.Draw(page, new PointF(10, 10));
    //Save the document.
    doc.Save("Output.pdf");
    //close the document
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a PdfGrid.
    Dim pdfGrid As New PdfGrid()
    'Create a DataTable.
    Dim dataTable As New DataTable()
    'Add columns to the DataTable
    dataTable.Columns.Add("ID")
    dataTable.Columns.Add("Name")
    'Add rows to the DataTable.
    dataTable.Rows.Add(New Object() {"E01", "Clay"})
    dataTable.Rows.Add(New Object() {"E02", "Thomas"})
    'Assign data source.
    pdfGrid.DataSource = dataTable
    'Using the Column collection
    pdfGrid.Columns(0).Width = 100
    'Adding grid row style
    Dim rowStyle As New PdfGridRowStyle()
    'Setting text pen for row
    rowStyle.TextBrush = PdfBrushes.Blue
    'Applying style to grid
    pdfGrid.Rows(0).Style = rowStyle
    'Draw grid to the page of PDF document.
    pdfGrid.Draw(page, New PointF(10, 10))
    'Save the document.
    doc.Save("Output.pdf")
    'close the document
    doc.Close(True)

    Implements

    System.ICloneable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved