PDF Alignment Issue

1 Answer 134 Views
GridView
vijay
Top achievements
Rank 1
vijay asked on 21 Sep 2022, 06:05 AM

Sir,

I am trying to export radgridview to PDF....But from Second columns its alignment is to Center alignment...How can i change the Alignment in PDF.

i am attaching the Code that i am using....Please help to solve the issue

Didi
Telerik team
commented on 21 Sep 2022, 06:07 AM

What is the Telerik technology you use in the project? The forum question is submitted for UI for UWP but in this suite, we do not have a GridView control. 
vijay
Top achievements
Rank 1
commented on 22 Sep 2022, 01:23 PM

Sir i am using vb.net and control i am using Radgridview control 2020
vijay
Top achievements
Rank 1
commented on 22 Sep 2022, 01:24 PM

winforms

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 26 Sep 2022, 09:46 AM

Hi vijay K,

Thank you for the provided details.

If I have correctly understood your case, you want to change the Text alignment of the cell in the exported PDF. Correct me if I am wrong. In this case, you can subscribe to the CellFormatting event of the GridViewPdfExport(CustomGridViewPdfExport in your case). Inside the event handler, you can set the TextAlignment property of the e.CellElement and its e.Column.

Private Sub PdfExporter_CellFormatting(ByVal sender As Object, ByVal e As PdfExportCellFormattingEventArgs)
    Dim column = e.Column
    Dim cellElement = e.CellElement
    e.CellElement.TextAlignment = ContentAlignment.MiddleRight
End Sub

Give this approach a try and let me know if it works for you.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
vijay
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or