Class PdfRowCollection
- Namespace
- Syncfusion.Pdf.Tables
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents the collection of the rows in a PdfLightTable.
public class PdfRowCollection : PdfCollection, IEnumerable
- Inheritance
-
PdfRowCollection
- Implements
- Inherited Members
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
this[int]
Gets the PdfColumn at the specified index.
public PdfRow this[int index] { get; }
Parameters
index
int
Property Value
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)
- See Also
Methods
Add(PdfRow)
Adds the specified row into collection.
public void Add(PdfRow row)
Parameters
- See Also
Add(object[])
Gets or sets the values which adds the row into PdfRowCollection.
public void Add(object[] values)
Parameters
values
object[]
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)
- See Also