Class EndRowLayoutEventArgs
Represents the arguments of EndRowLayoutEvent.
Inheritance
System.Object
System.EventArgs
EndRowLayoutEventArgs
Inherited Members
System.EventArgs.Empty
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 EndRowLayoutEventArgs : EventArgs
Examples
// Create a new document
PdfDocument document = new PdfDocument();
//Create a Page
PdfPage page = document.Pages.Add();
//Create DataTable for source
DataTable dataTable = new DataTable("myTable");
dataTable.Columns.Add("ID1");
dataTable.Columns[0].Caption = "id";
dataTable.Columns.Add("ID2");
object[] values = new object[] { "Roll Number", "Student Name" };
dataTable.Rows.Add(values);
values = new object[] { "011", "Cris" };
dataTable.Rows.Add(values);
values = new object[] { "011", "Clay" };
dataTable.Rows.Add(values);
//Create the PdfLightTable
PdfLightTable pdfLightTable = new PdfLightTable();
//Set the data source
pdfLightTable.DataSource = dataTable;
// Subscribe the end row event
pdfLightTable.EndRowLayout += new EndRowLayoutEventHandler(table_EndRowLayout);
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
void table_EndRowLayout(object sender, EndRowLayoutEventArgs args)
{
if (args.RowIndex == 1)
{
// Cancel property used to cancel the table rendering operation
args.Cancel = true;
}
}
' Create a new document
Dim document As New PdfDocument()
'Create a Page
Dim page As PdfPage = document.Pages.Add()
'Create DataTable for source
Dim dataTable As New DataTable("myTable")
dataTable.Columns.Add("ID1")
dataTable.Columns(0).Caption = "id"
dataTable.Columns.Add("ID2")
Dim values() As Object = { "Roll Number", "Student Name" }
dataTable.Rows.Add(values)
values = New Object() { "011", "Cris" }
dataTable.Rows.Add(values)
values = New Object() { "011", "Clay" }
dataTable.Rows.Add(values)
'Create the PdfLightTable
Dim pdfLightTable As New PdfLightTable()
'Set the data source
pdfLightTable.DataSource = dataTable
' Subscribe the end row event
AddHandler pdfLightTable.EndRowLayout, AddressOf table_EndRowLayout
'Draw PdfLightTable.
pdfLightTable.Draw(page, New PointF(0, 0))
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
Private Sub table_EndRowLayout(ByVal sender As Object, ByVal args As EndRowLayoutEventArgs)
If args.RowIndex = 1 Then
' Cancel property used to cancel the table rendering operation
args.Cancel = True
End If
End Sub
Properties
Bounds
Gets or sets the row bounds. Read-Only.
Declaration
public RectangleF Bounds { get; }
Property Value
Type | Description |
---|---|
System.Drawing.RectangleF |
Examples
// Create a new document
PdfDocument document = new PdfDocument();
//Create a Page
PdfPage page = document.Pages.Add();
//Create DataTable for source
DataTable dataTable = new DataTable("myTable");
dataTable.Columns.Add("ID1");
dataTable.Columns[0].Caption = "id";
dataTable.Columns.Add("ID2");
object[] values = new object[] { "Roll Number", "Student Name" };
dataTable.Rows.Add(values);
values = new object[] { "011", "Cris" };
dataTable.Rows.Add(values);
values = new object[] { "011", "Clay" };
dataTable.Rows.Add(values);
//Create the PdfLightTable
PdfLightTable pdfLightTable = new PdfLightTable();
//Set the data source
pdfLightTable.DataSource = dataTable;
// Subscribe the end row event
pdfLightTable.EndRowLayout += new EndRowLayoutEventHandler(table_EndRowLayout);
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
void table_EndRowLayout(object sender, EndRowLayoutEventArgs args)
{
//Get row bounds.
RectangleF bounds = args.Bounds;
if (args.RowIndex == 1)
{
// Cancel property used to cancel the table rendering operation
args.Cancel = true;
}
}
' Create a new document
Dim document As New PdfDocument()
'Create a Page
Dim page As PdfPage = document.Pages.Add()
'Create DataTable for source
Dim dataTable As New DataTable("myTable")
dataTable.Columns.Add("ID1")
dataTable.Columns(0).Caption = "id"
dataTable.Columns.Add("ID2")
Dim values() As Object = { "Roll Number", "Student Name" }
dataTable.Rows.Add(values)
values = New Object() { "011", "Cris" }
dataTable.Rows.Add(values)
values = New Object() { "011", "Clay" }
dataTable.Rows.Add(values)
'Create the PdfLightTable
Dim pdfLightTable As New PdfLightTable()
'Set the data source
pdfLightTable.DataSource = dataTable
' Subscribe the end row event
AddHandler pdfLightTable.EndRowLayout, AddressOf table_EndRowLayout
'Draw PdfLightTable.
pdfLightTable.Draw(page, New PointF(0, 0))
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
Private Sub table_EndRowLayout(ByVal sender As Object, ByVal args As EndRowLayoutEventArgs)
'Get row bounds.
Dim bounds As RectangleF = args.Bounds
If args.RowIndex = 1 Then
' Cancel property used to cancel the table rendering operation
args.Cancel = True
End If
End Sub
Cancel
Gets or sets a value indicating whether this row should be the last one printed.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Examples
// Create a new document
PdfDocument document = new PdfDocument();
//Create a Page
PdfPage page = document.Pages.Add();
//Create DataTable for source
DataTable dataTable = new DataTable("myTable");
dataTable.Columns.Add("ID1");
dataTable.Columns[0].Caption = "id";
dataTable.Columns.Add("ID2");
object[] values = new object[] { "Roll Number", "Student Name" };
dataTable.Rows.Add(values);
values = new object[] { "011", "Cris" };
dataTable.Rows.Add(values);
values = new object[] { "011", "Clay" };
dataTable.Rows.Add(values);
//Create the PdfLightTable
PdfLightTable pdfLightTable = new PdfLightTable();
//Set the data source
pdfLightTable.DataSource = dataTable;
// Subscribe the end row event
pdfLightTable.EndRowLayout += new EndRowLayoutEventHandler(table_EndRowLayout);
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
void table_EndRowLayout(object sender, EndRowLayoutEventArgs args)
{
if (args.RowIndex == 1)
{
// Cancel property used to cancel the table rendering operation
args.Cancel = true;
}
}
' Create a new document
Dim document As New PdfDocument()
'Create a Page
Dim page As PdfPage = document.Pages.Add()
'Create DataTable for source
Dim dataTable As New DataTable("myTable")
dataTable.Columns.Add("ID1")
dataTable.Columns(0).Caption = "id"
dataTable.Columns.Add("ID2")
Dim values() As Object = { "Roll Number", "Student Name" }
dataTable.Rows.Add(values)
values = New Object() { "011", "Cris" }
dataTable.Rows.Add(values)
values = New Object() { "011", "Clay" }
dataTable.Rows.Add(values)
'Create the PdfLightTable
Dim pdfLightTable As New PdfLightTable()
'Set the data source
pdfLightTable.DataSource = dataTable
' Subscribe the end row event
AddHandler pdfLightTable.EndRowLayout, AddressOf table_EndRowLayout
'Draw PdfLightTable.
pdfLightTable.Draw(page, New PointF(0, 0))
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
Private Sub table_EndRowLayout(ByVal sender As Object, ByVal args As EndRowLayoutEventArgs)
If args.RowIndex = 1 Then
' Cancel property used to cancel the table rendering operation
args.Cancel = True
End If
End Sub
LayoutCompleted
Gets a value indicating whether the row was drawn completely (nothing should be printed on the next page). Read-Only.
Declaration
public bool LayoutCompleted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Examples
// Create a new document
PdfDocument document = new PdfDocument();
//Create a Page
PdfPage page = document.Pages.Add();
//Create DataTable for source
DataTable dataTable = new DataTable("myTable");
dataTable.Columns.Add("ID1");
dataTable.Columns[0].Caption = "id";
dataTable.Columns.Add("ID2");
object[] values = new object[] { "Roll Number", "Student Name" };
dataTable.Rows.Add(values);
values = new object[] { "011", "Cris" };
dataTable.Rows.Add(values);
values = new object[] { "011", "Clay" };
dataTable.Rows.Add(values);
//Create the PdfLightTable
PdfLightTable pdfLightTable = new PdfLightTable();
//Set the data source
pdfLightTable.DataSource = dataTable;
// Subscribe the end row event
pdfLightTable.EndRowLayout += new EndRowLayoutEventHandler(table_EndRowLayout);
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
void table_EndRowLayout(object sender, EndRowLayoutEventArgs args)
{
bool isCompleted = args.LayoutCompleted;
if (args.RowIndex == 1)
{
// Cancel property used to cancel the table rendering operation
args.Cancel = true;
}
}
' Create a new document
Dim document As New PdfDocument()
'Create a Page
Dim page As PdfPage = document.Pages.Add()
'Create DataTable for source
Dim dataTable As New DataTable("myTable")
dataTable.Columns.Add("ID1")
dataTable.Columns(0).Caption = "id"
dataTable.Columns.Add("ID2")
Dim values() As Object = { "Roll Number", "Student Name" }
dataTable.Rows.Add(values)
values = New Object() { "011", "Cris" }
dataTable.Rows.Add(values)
values = New Object() { "011", "Clay" }
dataTable.Rows.Add(values)
'Create the PdfLightTable
Dim pdfLightTable As New PdfLightTable()
'Set the data source
pdfLightTable.DataSource = dataTable
' Subscribe the end row event
AddHandler pdfLightTable.EndRowLayout, AddressOf table_EndRowLayout
'Draw PdfLightTable.
pdfLightTable.Draw(page, New PointF(0, 0))
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
Private Sub table_EndRowLayout(ByVal sender As Object, ByVal args As EndRowLayoutEventArgs)
Dim isCompleted As Boolean = args.LayoutCompleted
If args.RowIndex = 1 Then
' Cancel property used to cancel the table rendering operation
args.Cancel = True
End If
End Sub
RowIndex
Gets the index of the row. Read-Only.
Declaration
public int RowIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Examples
// Create a new document
PdfDocument document = new PdfDocument();
//Create a Page
PdfPage page = document.Pages.Add();
//Create DataTable for source
DataTable dataTable = new DataTable("myTable");
dataTable.Columns.Add("ID1");
dataTable.Columns[0].Caption = "id";
dataTable.Columns.Add("ID2");
object[] values = new object[] { "Roll Number", "Student Name" };
dataTable.Rows.Add(values);
values = new object[] { "011", "Cris" };
dataTable.Rows.Add(values);
values = new object[] { "011", "Clay" };
dataTable.Rows.Add(values);
//Create the PdfLightTable
PdfLightTable pdfLightTable = new PdfLightTable();
//Set the data source
pdfLightTable.DataSource = dataTable;
// Subscribe the end row event
pdfLightTable.EndRowLayout += new EndRowLayoutEventHandler(table_EndRowLayout);
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
void table_EndRowLayout(object sender, EndRowLayoutEventArgs args)
{
if (args.RowIndex == 1)
{
// Cancel property used to cancel the table rendering operation
args.Cancel = true;
}
}
' Create a new document
Dim document As New PdfDocument()
'Create a Page
Dim page As PdfPage = document.Pages.Add()
'Create DataTable for source
Dim dataTable As New DataTable("myTable")
dataTable.Columns.Add("ID1")
dataTable.Columns(0).Caption = "id"
dataTable.Columns.Add("ID2")
Dim values() As Object = { "Roll Number", "Student Name" }
dataTable.Rows.Add(values)
values = New Object() { "011", "Cris" }
dataTable.Rows.Add(values)
values = New Object() { "011", "Clay" }
dataTable.Rows.Add(values)
'Create the PdfLightTable
Dim pdfLightTable As New PdfLightTable()
'Set the data source
pdfLightTable.DataSource = dataTable
' Subscribe the end row event
AddHandler pdfLightTable.EndRowLayout, AddressOf table_EndRowLayout
'Draw PdfLightTable.
pdfLightTable.Draw(page, New PointF(0, 0))
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
Private Sub table_EndRowLayout(ByVal sender As Object, ByVal args As EndRowLayoutEventArgs)
If args.RowIndex = 1 Then
' Cancel property used to cancel the table rendering operation
args.Cancel = True
End If
End Sub