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

documentruler measurementUnit

1 Answer 65 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Valentijn
Top achievements
Rank 1
Valentijn asked on 22 Aug 2011, 01:42 PM
Hi

Did anyone try to change the MeasurementUnit of the DocumentRuler control to 'Cm'? This does not seem to work. The ruler is not affected after changing the property.

Valentijn

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 25 Aug 2011, 03:07 PM
Hi Valentijn,

There is an issue with the measurement unit of DocumentRuler being lost after the template of the control is applied. We will make sure to fix this, but as a workaround, you can set the measurement unit of the ruler in code-behind after its template is applied like this:

this.documentRuler.MeasurementUnit = UnitTypes.Cm;

If you would like to have the document rules using centimeters from the beginning, you can set the measurement unit on Loaded of the page like this:
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
    Dispatcher.BeginInvoke(new Action(delegate()
    {
        this.documentRuler.MeasurementUnit = UnitTypes.Cm;
    }));
}
Kind regards,
Iva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
RichTextBox
Asked by
Valentijn
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or