Disable 'add to dictionary'?

5 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Sep 2014

    Posted 19 Sep 2014 Link to this post

    Is there a way to disable the add to dictionary button from the dialog created in the WinControls RadSpellChecker?
  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3331 posts

    Posted 24 Sep 2014 Link to this post

    Hello David,

    Thank you for writing.

    You can subscribe to the SpellingFormShowing event and hide or disable the "Add To Dictionary" button accessing the respective control via the Form.Controls collection:
    private void radSpellChecker1_SpellingFormShowing(object sender, SpellingFormShowingEventArgs e)
    {
        //e.SpellingForm.Controls["buttonAddToDictionary"].Visible = false;
        e.SpellingForm.Controls["buttonAddToDictionary"].Enabled = false;
    }

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. MS
    MS avatar
    4 posts
    Member since:
    Feb 2012

    Posted 30 Sep 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hello,

    How about the one that displayed in the context menu when you choose AutoSpellCheck? Is there a way to disable the 'add to dictionary' menu?

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

    Posted 02 Oct 2017 Link to this post

    Hello, Machiko, 

    Thank you for writing.  

    Here is a sample code snippet demonstrating how to disable the "Add to Dictionary" item in the context menu when a RadSpellChecker is used to auto spellchecked the RadTextBox:
    public RadForm1()
    {
        InitializeComponent();
     
        this.radSpellChecker1.AutoSpellCheckControl = this.radTextBox1;
     
        TextBoxSpellChecker textSpellChecker = this.radSpellChecker1.GetControlSpellChecker(typeof(RadTextBox)) as TextBoxSpellChecker;
        if (textSpellChecker != null)
        {
            textSpellChecker.DropDownMenu.PopupOpening += DropDownMenu_PopupOpening;
        }
    }
     
    private void DropDownMenu_PopupOpening(object sender, CancelEventArgs args)
    {
        RadDropDownMenu menu = sender as RadDropDownMenu;
        foreach (RadItem item in menu.Items)
        {
            if (item.Text.Contains("Add to Dictionary"))
            {
                item.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
            }
        }
    }

    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 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. MS
    MS avatar
    4 posts
    Member since:
    Feb 2012

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

    Thank you it worked! 
Back to Top