This is a migrated thread and some comments may be shown as answers.

Cell vertical aligment

3 Answers 113 Views
WordsProcessing
This is a migrated thread and some comments may be shown as answers.
Dina
Top achievements
Rank 1
Dina asked on 01 May 2017, 01:04 AM

How to align content in cell vertically?

cell.VerticalAlignment = Telerik.Windows.Documents.Flow.Model.Styles.VerticalAlignment.Center;

does not help me. Text is still align at top

cell = row.Cells.AddTableCell();
cell.VerticalAlignment = Telerik.Windows.Documents.Flow.Model.Styles.VerticalAlignment.Center;
cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 15);
paragraph = cell.Blocks.AddParagraph();
run = paragraph.Inlines.AddRun();
run.Text = "Text in cell text in cell text in cell";

3 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 03 May 2017, 08:25 AM
Hi Dima,

The vertical alignment property is not supported when exporting RadFlowDocument do PDF. If this is your case, you can vote for an implementation as well as track the status of the task using the related public item.

The property should be properly applied if you are using one of the other supported document formats. In case you are experiencing an issue in such a scenario, please send us more information on how we could reproduce it on our end.

Regards,
Tanya
Telerik by Progress

0
Dina
Top achievements
Rank 1
answered on 03 May 2017, 10:45 AM

Is this only export to PDF issue?

Being able to align text in cell to center is a pretty basic feature. Might be I misunderstand you.

Or presented I presented wrong example.

Attaching DOCx to demonstrate
0
Tanya
Telerik team
answered on 05 May 2017, 03:54 PM
Hi Dima,

Yes, the vertical alignment is not supported only when exporting to PDF. For generating DOCX documents, you shouldn't experience any issues. 

I am not sure I completely understand your scenario and what is the issue you are observing. The document from the image you shared seems to have the vertical alignment of the cell properly applied. Isn't it?

I am sending you a sample project showing how you can generate a sample DOCX document with a table containing only a single cell with VerticalAlignment=Center.

Hope this is useful.

Regards,
Tanya
Telerik by Progress

Tags
WordsProcessing
Asked by
Dina
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Dina
Top achievements
Rank 1
Share this question
or