Set UseMnemonic to false for Breadcrumb

7 posts, 1 answers
  1. Patrick
    Patrick avatar
    43 posts
    Member since:
    Aug 2018

    Posted 09 Oct 2018 Link to this post

    Hello,

    Is there a way to set UseMnemonic to false for the Breadcrumb?

    Setting UseMnemonic to false for the linked treeview seems not be the solution.

     

    Grtz Patrick Vossen

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3835 posts

    Posted 11 Oct 2018 Link to this post

    Hello, Patrick, 

    By default, the UseMnemonic property is available for any TextPrimitive's or LightVisualElement's derivative. For example, the RadTreeViewElement is a derivative of LightVisualElement. That is why it has the UseMnemonic property. However, RadBreadCrumb doesn't offer such property. Could you please give us some more information about the exact requirement that you are trying to achieve. Once, we get a better understanding of your precise case, we would be able to think about a suitable solution and assist you further. Thank you in advance.

    I am looking forward to your reply.

    Regards,
    Dess
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Patrick
    Patrick avatar
    43 posts
    Member since:
    Aug 2018

    Posted 11 Oct 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hello Dess,

    Some of the treeview items contain the '&'-sign in the text.

    These &-signs are shown correctly in the treeview but not in the breadcrumb (see attached image).

    The RadBreadcrumb control is linked to the treeview (Me.RadBreadCrumb1.DefaultTreeView = Me.RadTreeView1)

     

    Grtz Patrick

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3835 posts

    Posted 11 Oct 2018 Link to this post

    Hello, Patrick, 

    The provided screenshot and detailed explanation is greatly appreciated. You can handle the RadTreeView.NodeFormatting event and set the NodeElement.ContentElement.UseMnemonic property to false. Thus, the "&" will be displayed as plain text. As to the RadBreadCrumb, you can iterate all items and set the RadSplitButtonElement.ActionButton.TextElement.UseMnemonic property to false. Here is a sample code snippet: 

    this.radTreeView1.NodeFormatting += radTreeView1_NodeFormatting;
    this.radTreeView1.SelectedNodeChanged += radTreeView1_SelectedNodeChanged;


    private void radTreeView1_SelectedNodeChanged(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e)
    {
        foreach (RadSplitButtonElement item in this.radBreadCrumb1.BreadCrumbElement.Items)
        {
            item.ActionButton.TextElement.UseMnemonic = false;
        }
    }
      
    private void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e)
    {
        e.NodeElement.ContentElement.UseMnemonic = false;
    }




    Should you have further questions please let me know.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Patrick
    Patrick avatar
    43 posts
    Member since:
    Aug 2018

    Posted 12 Oct 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi Dess,

    Thanks for the solution. At first I did not get the solution working. The reason that it did not worked was the sequence of code:

    Did not work:

    private void RadForm1_Load(object sender, EventArgs e) {
        this.radTreeView1.NodeFormatting += radTreeView1_NodeFormatting;
        this.radTreeView1.SelectedNodeChanged += radTreeView1_SelectedNodeChanged;
        radBreadCrumb1.DefaultTreeView = this.radTreeView1;
    }

     

    But this works:

    private void RadForm1_Load(object sender, EventArgs e) {
        radBreadCrumb1.DefaultTreeView = this.radTreeView1;
        this.radTreeView1.NodeFormatting += radTreeView1_NodeFormatting;
        this.radTreeView1.SelectedNodeChanged += radTreeView1_SelectedNodeChanged;
    }

     

    But now I have still the following exception that the DropDownMenu does not handle the & "correctly" (see attached image)

     

  6. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3835 posts

    Posted 15 Oct 2018 Link to this post

    Hello, Patrick, 

    Indeed, when you set the DefaultTreeView property after you have subscribed to the RadTreeView event, the mnemonics will be displayed. 

    I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

    I have also updated your Telerik points.

    Currently, the possible solution that I can suggest is to set the DefaultTreeView before subscribing to the tree view events.

     
    this.radBreadCrumb1.DefaultTreeView = this.radTreeView1;
    this.radTreeView1.NodeFormatting += radTreeView1_NodeFormatting;
    this.radTreeView1.SelectedNodeChanged += radTreeView1_SelectedNodeChanged;

    As to the drop down menu items, you can disable the mnemonics as well as follows: 
    private void radTreeView1_SelectedNodeChanged(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e)
    {
        foreach (RadSplitButtonElement item in this.radBreadCrumb1.BreadCrumbElement.Items)
        {
            item.ActionButton.TextElement.UseMnemonic = false;
            foreach (RadMenuItem i in item.Items)
            {
                i.Layout.Text.UseMnemonic = false;
            }
        }
    }



    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  7. Patrick
    Patrick avatar
    43 posts
    Member since:
    Aug 2018

    Posted 24 Oct 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi Dess,

    Thanks for the solution, it works perfectly.

    Grtz Patrick Vossen

Back to Top