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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PdfPageNumberField in PdfGridCell

Thread ID:





119953 Aug 18,2015 01:32 PM UTC Aug 21,2015 12:28 PM UTC ASP.NET MVC 3
Tags: PDF
Martin Bach
Asked On August 18, 2015 01:32 PM UTC

I want to insert the page number (PdfPageNumberField) into a grid cell (in the grid footer).  Can't figure out how to do that.

Abirami Selvan [Syncfusion]
Replied On August 19, 2015 02:27 PM UTC

Hi Martin,
Thank you for using Syncfusion product.
We do not have support for drawing the page number using PdfNumerField class in a particular PdfGridcell value. Currently , we have the support to draw the text and another grid(nested grid) in a particular grid cell. However you can manually calculate the page number and  set as grid cell value.
You can refer below link for the usage of page number in PDF footer.
Please let us know if you have any further assistance.

Martin Bach
Replied On August 20, 2015 07:43 AM UTC


thank you for your anwser.

I do not know how to calculate the page number manually and i do not find anything in the Forums...

Could You explain how to calculate the page number manually?`

Thank You

Abirami Selvan [Syncfusion]
Replied On August 21, 2015 12:28 PM UTC

Hi Martin,
We can calculate the page number using  BeginPageLayout event in PdfGrid. We have created the sample for calculating the page number manually in PdfGrid.
Please refer the below code snippet :
//call the events


//Draw grid to the page of PDF document.

pdfGrid.Draw(page, new PointF(10, 10), layoutFormat);

private void pdfGrid_BeginPageLayout(object sender, BeginPageLayoutEventArgs e)


//Set page number when each page starts
(sender as PdfGrid).Rows[i].Cells[0].Value = "Page - "+pageNumebr.ToString();
Please refer the sample in the below link:
Please try this and let us know if you have any further assistance.


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