Editable Header

5 posts, 1 answers
  1. Paul
    Paul avatar
    42 posts
    Member since:
    Jan 2012

    Posted 04 Jun 2013 Link to this post

    I have followed the following example to make a Header editable in the RadPane for the end user.
    http://www.telerik.com/help/silverlight/radtabcontrol-how-to-make-the-tab-headers-editable.html

    I am having difficulty setting focus to the TextBox in the EditableContentControl.  The end requiremetn is to select all the text when the users double clicks the header text.  I was hoping this would be as simple as calling SelectAll and Focus on the TextBox when the mode is set for edit but focus is not in that control.  Snoop shows that the mouse event was handled and just for a long shot I removed the e.Handled = true just as a test. 

    Within the RadPane I have a GridView and I can see the rows changing color as I mouse over them.  I am aware of the difference between keyboard and logical focus but I simply cannot get focus regardless of what I do, including directly using the FocusManager.

    Can you provide some assistance?

    Thank you

    Paul
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 07 Jun 2013 Link to this post

    Hi,

    We are not sure with which control this issue is related. Are you sure you are using RadDocking control as the link of the article is related to the RadTabControl. If you have an issue with the Docking control there could be some unexpected issues with the described approach in the documentation article as it is for a different control. We also noticed that the forum is opened under the WPF platform but the article link is for Silverlight. You should note that the approach for achieving such functionality in the TabControl is different for the two platforms.

    We created and attached a sample project for you for the RadTabControl (Silverlight) with the described behavior, hope this is helpful. If you are indeed adding those customizations to the RadDocking control could you try to reproduce the issue in a sample project and send it to us in a new support ticket.

    Regards,
    Vladi
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Paul
    Paul avatar
    42 posts
    Member since:
    Jan 2012

    Posted 07 Jun 2013 Link to this post

    The EdiableContentControl used in the example I referenced did work quite nicely in my project.  It is using WPF and I am applying it to a RadPane.  I have worked quite a bit with Konstantina on a related topic, ticket 677626.  The code I attached on May 23 will demonstrate my use case.  This code sample is much more complicated than this issue but it does utilize the EditableContentControl.

    Thanks

    Paul
  5. Answer
    Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 10 Jun 2013 Link to this post

    Hi,

    In order to select the text in the editable Pane Header you will need to do the following:
    • Attache the GotFocus event to the TextBox of that Header in your EditableContentControl class in the OnApplyTemplate method.
    • In that GotFocus select the text with the use of the SelectAll() method.
    • In your QueueWindowResources file add a trigger that sets the FocusManager.FocusedElement to that TextBox in the ControlTemplate of your custom EditableContentControl control.

    We updated your project from the other support thread with the described approach, we also replaced the Template with a more correct Template as we noticed that you have copied the Silverlight Template that uses VisualState rather then the WPF one that uses only Triggers.

    Hope this is helpful.


    Regards,
    Vladi
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Paul
    Paul avatar
    42 posts
    Member since:
    Jan 2012

    Posted 11 Jun 2013 Link to this post

    Thank you for your assistance.  I should have done this in the first place rather than my other attempts.  Also, thank you for providing changes to the style based upon my using the Silverlight style.

    Paul
Back to Top
UI for WPF is Visual Studio 2017 Ready