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

change Pagesize in Q1 2012?

1 Answer 30 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
robert
Top achievements
Rank 1
robert asked on 21 Feb 2012, 11:31 AM
Hello i used in Q3 to init the page and default settings following codesnippet.
ChangePageSize is not recognized and also ChangeSectionMargin is now not a member of richtextbox?
How can i set it in code behind like in Q3?
Thanks ...
'Default ---------------------
.FontFamily = New FontFamily("Times New Roman")
.FontSize = Unit.PointToDip(12)
.FontStyle = FontStyles.Normal
.FontWeight = FontWeights.Normal
'Zeilenabstand ---------------
.ChangeParagraphSpacingAfter(0)
.ChangeParagraphSpacingBefore(0)
.ChangeParagraphLineSpacing(1)
'Seitenränder Normal ---------
.Document.SectionDefaultPageMargin = New Telerik.Windows.Documents.Layout.Padding(96, 96, 96, 96)
.ChangeSectionMargin(New Telerik.Windows.Documents.Layout.Padding(96, 96, 96, 96))
'A4 --------------------------
.ChangePageSize(New SizeF(793, 1056))
'Set -------------------------
.DocumentInheritsDefaultStyleSettings = True
.UpdateEditorLayout()

1 Answer, 1 is accepted

Sort by
0
Alex
Telerik team
answered on 24 Feb 2012, 09:20 AM
Hi,

In Q1 we introduced multiple sections support in the RadRichTextBox. With this change we marked some method of the control as obsolete - they can still be used, but you will not be able to see them in intellisense and Visual Studio will generate a warning (or in some cases error, if you have a stricter code policy) when they are compiled. 
The two methods you named fall in that category. Here is what you can do:
- Instead of ChangeSectionMargin use the ChangeSectionPageMargin methos.
Use the ChangePageSize but give it a Size parameter - not SizeF.

I hope this is helpful.

Regards,
Alex
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
RichTextBox
Asked by
robert
Top achievements
Rank 1
Answers by
Alex
Telerik team
Share this question
or