Cannot find TextOrientation through API

3 posts, 0 answers
  1. Maria
    Maria avatar
    4 posts
    Member since:
    Jan 2018

    Posted 24 Jan 2018 Link to this post

    Hello there,

    I added a RadButton to my WInForm and although I can find TextPrimitive.TextOrientation property in the Designer, I cannot find it through the Telerik API so I can change it in runtime!

    Telerik Designer and API are not consistent with each other?

    Any idea on how I can resolve my problem?  

    Thank you,

    Maria

  2. Maria
    Maria avatar
    4 posts
    Member since:
    Jan 2018

    Posted 24 Jan 2018 in reply to Maria Link to this post

    You can delete this post, it was my fault. 

    If you wanna keep it for future reference the code line goes like that:

     

    <p>((Telerik.WinControls.Primitives.TextPrimitive)(myButton.ButtonElement.Children[1])).TextOrientation = 270;</p><p></p>

     

  3. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4080 posts

    Posted 25 Jan 2018 Link to this post

    Hello, Maria,

    Thank you for writing.  

    The TextOrientation property doesn't accept numeric values but the Horizontal/Vertical options of the Orientation enum. It is not a suitable approach to use the Children collection for accessing some of the inner elements. You can directly set the RadButton.ButtonElement.TextOrientation property: 
    this.radButton1.ButtonElement.TextOrientation = Orientation.Vertical;



    I would recommend you to have a look at the following help article which will get you familiar with the internal structure of RadButton: https://docs.telerik.com/devtools/winforms/buttons/button/structure 

    I hope this information helps. Should you have further questions I would be glad to help. 
     
     Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top