Class EndCellLayoutEventHandler
Represents the method that will handle EndCellLayout event of PdfLightTable.
Inheritance
System.Object
EndCellLayoutEventHandler
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public sealed class EndCellLayoutEventHandler : MulticastDelegate
Remarks
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();
// Subscribe the cell layout event
pdfLightTable.EndCellLayout += new EndCellLayoutEventHandler(table_EndCellLayout);
pdfLightTable.DataSource = dataTable;
pdfLightTable.Style.CellPadding = 16;
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
// Cell layout event handler
void table_EndCellLayout(object sender, EndCellLayoutEventArgs args)
{
if (args.RowIndex == 1)
{
args.Graphics.DrawRectangle(new PdfPen(PdfBrushes.Red, 2), PdfBrushes.White, args.Bounds);
}
}
' 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()
' Subscribe the cell layout event
AddHandler pdfLightTable.EndCellLayout, AddressOf table_EndCellLayout
pdfLightTable.DataSource = dataTable
pdfLightTable.Style.CellPadding = 16
'Draw PdfLightTable.
pdfLightTable.Draw(page, New PointF(0, 0))
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
' Cell layout event handler
Private Sub table_EndCellLayout(ByVal sender As Object, ByVal args As EndCellLayoutEventArgs)
If args.RowIndex = 1 Then
args.Graphics.DrawRectangle(New PdfPen(PdfBrushes.Red, 2), PdfBrushes.White, args.Bounds)
End If
End Sub
Constructors
EndCellLayoutEventHandler(Object, IntPtr)
Declaration
public EndCellLayoutEventHandler(object object, IntPtr method)
Parameters
Type |
Name |
Description |
System.Object |
object |
|
System.IntPtr |
method |
|
Methods
BeginInvoke(Object, EndCellLayoutEventArgs, AsyncCallback, Object)
Declaration
public virtual IAsyncResult BeginInvoke(object sender, EndCellLayoutEventArgs args, AsyncCallback callback, object object)
Parameters
Type |
Name |
Description |
System.Object |
sender |
|
EndCellLayoutEventArgs |
args |
|
System.AsyncCallback |
callback |
|
System.Object |
object |
|
Returns
EndInvoke(IAsyncResult)
Declaration
public virtual void EndInvoke(IAsyncResult result)
Parameters
Type |
Name |
Description |
System.IAsyncResult |
result |
|
Invoke(Object, EndCellLayoutEventArgs)
Declaration
public virtual void Invoke(object sender, EndCellLayoutEventArgs args)
Parameters
See Also