menu

Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfRowCollection - Xamarin.Android API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfRowCollection

    Represents the collection of the rows in a PdfLightTable.

    Inheritance
    System.Object
    PdfCollection
    PdfRowCollection
    Implements
    System.Collections.IEnumerable
    Inherited Members
    PdfCollection.Count
    PdfCollection.GetEnumerator()
    PdfCollection.List
    Namespace: Syncfusion.Pdf.Tables
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public class PdfRowCollection : PdfCollection, IEnumerable
    Examples
    // Create a new document
    PdfDocument document = new PdfDocument();
    //Create a new page
    PdfPage page = document.Pages.Add();
    // Create a new table
    PdfLightTable table = new PdfLightTable();
    // Set the DataSourceType as Direct
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
    // Creating Columns
    table.Columns.Add(new PdfColumn("Roll Number"));
    table.Columns.Add(new PdfColumn("Name"));
    table.Columns.Add(new PdfColumn("Class"));
    // get the row collection
    PdfRowCollection rowCollection = table.Rows;
    //Add the rows
    rowCollection.Add(new object[] { "111", "Maxim", "III" });
    // Draw the table
    table.Draw(page, new PointF(0, 0));
    //Save the document
    document.Save("Output.pdf");
    //Close the document
    document.Close(true);
    ' Create a new document
    Dim document As New PdfDocument()
    'Create a new page
    Dim page As PdfPage = document.Pages.Add()
    ' Create a new table
    Dim table As New PdfLightTable()
    ' Set the DataSourceType as Direct
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect
    ' Creating Columns
    table.Columns.Add(New PdfColumn("Roll Number"))
    table.Columns.Add(New PdfColumn("Name"))
    table.Columns.Add(New PdfColumn("Class"))
    ' get the row collection
    Dim rowCollection As PdfRowCollection = table.Rows
    'Add the rows
    rowCollection.Add(New Object() { "111", "Maxim", "III" })
    ' Draw the table
    table.Draw(page, New PointF(0, 0))
    'Save the document
    document.Save("Output.pdf")
    'Close the document
    document.Close(True)

    Properties

    Item[Int32]

    Gets the PdfColumn at the specified index.

    Declaration
    public PdfRow this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type
    PdfRow
    Examples
    // Create a new document
    PdfDocument document = new PdfDocument();
    //Create a new page
    PdfPage page = document.Pages.Add();
    // Create a new table
    PdfLightTable table = new PdfLightTable();
    // Set the DataSourceType as Direct
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
    // Creating Columns
    table.Columns.Add(new PdfColumn("Roll Number"));
    table.Columns.Add(new PdfColumn("Name"));
    table.Columns.Add(new PdfColumn("Class"));
    // get the row collection
    PdfRowCollection rowCollection = table.Rows;
    //Add the rows
    rowCollection.Add(new object[] { "111", "Maxim", "III" });
    //Get the row by index.
    PdfRow row = rowCollection[0];
    // Draw the table
    table.Draw(page, new PointF(0, 0));
    //Save the document
    document.Save("Output.pdf");
    //Close the document
    document.Close(true);
    ' Create a new document
    Dim document As New PdfDocument()
    'Create a new page
    Dim page As PdfPage = document.Pages.Add()
    ' Create a new table
    Dim table As New PdfLightTable()
    ' Set the DataSourceType as Direct
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect
    ' Creating Columns
    table.Columns.Add(New PdfColumn("Roll Number"))
    table.Columns.Add(New PdfColumn("Name"))
    table.Columns.Add(New PdfColumn("Class"))
    ' get the row collection
    Dim rowCollection As PdfRowCollection = table.Rows
    'Add the rows
    rowCollection.Add(New Object() { "111", "Maxim", "III" })
    //Get the row by index.
    Dim row As PdfRow = rowCollection(0)
    ' Draw the table
    table.Draw(page, New PointF(0, 0))
    'Save the document
    document.Save("Output.pdf")
    'Close the document
    document.Close(True)

    Methods

    Add(PdfRow)

    Adds the specified row into collection.

    Declaration
    public void Add(PdfRow row)
    Parameters
    Type Name Description
    PdfRow row

    The PdfRow to be added into list.

    Add(Object[])

    Gets or sets the values which adds the row into PdfRowCollection.

    Declaration
    public void Add(object[] values)
    Parameters
    Type Name Description
    System.Object[] values
    Examples
    // Create a new document
    PdfDocument document = new PdfDocument();
    //Create a new page
    PdfPage page = document.Pages.Add();
    // Create a new table
    PdfLightTable table = new PdfLightTable();
    // Set the DataSourceType as Direct
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
    // Creating Columns
    table.Columns.Add(new PdfColumn("Roll Number"));
    table.Columns.Add(new PdfColumn("Name"));
    table.Columns.Add(new PdfColumn("Class"));
    // get the row collection
    PdfRowCollection rowCollection = table.Rows;
    //Add the rows
    rowCollection.Add(new object[] { "111", "Maxim", "III" });
    // Draw the table
    table.Draw(page, new PointF(0, 0));
    //Save the document
    document.Save("Output.pdf");
    //Close the document
    document.Close(true); 
    ' Create a new document
    Dim document As New PdfDocument()
    'Create a new page
    Dim page As PdfPage = document.Pages.Add()
    ' Create a new table
    Dim table As New PdfLightTable()
    ' Set the DataSourceType as Direct
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect
    ' Creating Columns
    table.Columns.Add(New PdfColumn("Roll Number"))
    table.Columns.Add(New PdfColumn("Name"))
    table.Columns.Add(New PdfColumn("Class"))
    ' get the row collection
    Dim rowCollection As PdfRowCollection = table.Rows
    'Add the rows
    rowCollection.Add(New Object() { "111", "Maxim", "III" })
    ' Draw the table
    table.Draw(page, New PointF(0, 0))
    'Save the document
    document.Save("Output.pdf")
    'Close the document
    document.Close(True)

    Implements

    System.Collections.IEnumerable

    See Also

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