how to make the beginning and end label of Y-Axis editable

4 posts, 2 answers
  1. mao
    mao avatar
    4 posts
    Member since:
    Oct 2016

    Posted 04 Oct Link to this post

    how to make  the beginning and end label  of Y-Axis editable (if could assgin a template to edit, it will be nicer)

     

    Thank you

  2. Answer
    Martin
    Admin
    Martin avatar
    1101 posts

    Posted 07 Oct Link to this post

    Hello Mao,

    In order to change the appearance of the first and last label of the axis you can use its LabelTemplateSelector property and based on a condition (if first or last label in your case) choose a different template. 

    About the "editable" part, I am not sure what exactly you want to edit? Note that if you edit the values of the first and last labels without editing the labels between them the visualization will be incorrect. In order to make the edit meaningful in a numeric axis, you might need to also update the Minimum/Maximum and the MajorStep of the axis.

    Regards,
    Martin
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. mao
    mao avatar
    4 posts
    Member since:
    Oct 2016

    Posted 07 Oct in reply to Martin Link to this post

    Thank you so much, Martin. LabelTemplateSelector is doing its work. But how to know the label is the first or the end? Thank you
  5. Answer
    Martin
    Admin
    Martin avatar
    1101 posts

    Posted 10 Oct Link to this post

    Hi Mao,

    This depends on the set up of the axis - the minimum, maximum and the major step. You can get or set those via the Maximum, Minimum, MajorStep, ActualRange, ActualMajorStep properties. You can use the properties to set up or calculate the first/last label. 

    Another approach could be to get the first and the last text blocks representing the labels in the visual tree of the axis.

    Regards,
    Martin
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top