Class PdfRowCollection
Represents the collection of the rows in a PdfLightTable.
Implements
System.Collections.IEnumerable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Tables
Assembly: Syncfusion.Pdf.Base.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 | Description |
---|---|
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