Delegate BeginRowLayoutEventHandler
Represents the method that handles StartRowLayout event of PdfLightTable.
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public delegate void BeginRowLayoutEventHandler(object sender, BeginRowLayoutEventArgs args);
Parameters
Type |
Name |
Description |
System.Object |
sender |
The sender of the event.
|
BeginRowLayoutEventArgs |
args |
The arguments of the event.
|
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 begin row event
pdfLightTable.BeginRowLayout += new BeginRowLayoutEventHandler(table_BeginRowLayout);
//Set the data source
pdfLightTable.DataSource = dataTable;
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
void table_BeginRowLayout(object sender, BeginRowLayoutEventArgs args)
{
if (args.RowIndex == 1)
{
PdfLightTable table = (PdfLightTable)sender;
int count = table.Columns.Count;
int[] spanMap = new int[count];
// Set just spanned cells. Other values are not important except negatives that are not allowed.
spanMap[0] = 2;
spanMap[1] = 3;
args.ColumnSpanMap = spanMap;
//Set row height.
args.MinimalHeight = 30f;
}
}
' 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 begin row event
AddHandler pdfLightTable.BeginRowLayout, AddressOf table_BeginRowLayout
'Set the data source
pdfLightTable.DataSource = dataTable
'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_BeginRowLayout(ByVal sender As Object, ByVal args As BeginRowLayoutEventArgs)
If args.RowIndex = 1 Then
Dim table As PdfLightTable = CType(sender, PdfLightTable)
Dim count As Integer = table.Columns.Count
Dim spanMap(count - 1) As Integer
' Set just spanned cells. Other values are not important except negatives that are not allowed.
spanMap(0) = 2
spanMap(1) = 3
args.ColumnSpanMap = spanMap
'Set row height.
args.MinimalHeight = 30f
End If
End Sub
Constructors
BeginRowLayoutEventHandler(Object, IntPtr)
Declaration
public BeginRowLayoutEventHandler(object object, IntPtr method)
Parameters
Type |
Name |
Description |
System.Object |
object |
|
System.IntPtr |
method |
|
Methods
BeginInvoke(Object, BeginRowLayoutEventArgs, AsyncCallback, Object)
Declaration
public virtual IAsyncResult BeginInvoke(object sender, BeginRowLayoutEventArgs args, AsyncCallback callback, object object)
Parameters
Type |
Name |
Description |
System.Object |
sender |
|
BeginRowLayoutEventArgs |
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, BeginRowLayoutEventArgs)
Declaration
public virtual void Invoke(object sender, BeginRowLayoutEventArgs args)
Parameters
See Also