We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Draw Line Inside a row in pdflighttable ?

Thread ID:

Created:

Updated:

Platform:

Replies:

143104 Mar 5,2019 08:53 AM UTC Mar 7,2019 01:10 AM UTC Xamarin.Forms 1
loading
Tags: PDF
Nouman Khalid
Asked On March 5, 2019 08:53 AM UTC

Hello i just want to know that how can we add a line inside a row in pdflighttable ? 

Karthikeyan Chandrasekar [Syncfusion]
Replied On March 7, 2019 01:10 AM UTC

Hi Nouman, 
  
Greetings from Syncfusion. We can add a line to a row of PdfLightTable using the below code snippet. 
  
            //Create a new PDF document 
            PdfDocument document = new PdfDocument(); 
  
            //Add a page 
            PdfPage page = document.Pages.Add(); 
  
            //Create a PdfLightTable 
            PdfLightTable pdfLightTable = new PdfLightTable(); 
  
            //Create a DataTable 
            DataTable dataTable = new DataTable(); 
  
            //Add columns to data table 
            dataTable.Columns.Add(""); 
  
            //Add row 
            dataTable.Rows.Add(); 
  
            //Assign data source 
            pdfLightTable.DataSource = dataTable; 
  
            pdfLightTable.BeginCellLayout += pdfLightTable_BeginCellLayout; 
  
            //Draw light table to the page of PDF document 
            pdfLightTable.Draw(page, new RectangleF(0, 50, page.GetClientSize().Width, page.GetClientSize().Height)); 
  
>>>>>>>>>>>>>>  
  
//Event handler to draw line in row 
        private void pdfLightTable_BeginCellLayout(object sender, BeginCellLayoutEventArgs args) 
        {          
            //Draw Line 
            if (args.CellIndex == 0) 
            { 
                //Draw Line 
                args.Graphics.DrawLine(PdfPens.Red, new PointF(args.Bounds.X, args.Bounds.Y+5),new PointF(args.Bounds.X+ args.Bounds.Width, args.Bounds.Y+5)); 
                
            }           
        }          
  
Kindly try this in your end and let us know if you need any further assistance on this. 
Regards, 
Karthikeyan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon