Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Carousel > Scroll wheel issue when RadRichTextBox is inside Radcarousel

Not answered Scroll wheel issue when RadRichTextBox is inside Radcarousel

Feed from this thread
  • Haifeng avatar

    Posted on Oct 5, 2011 (permalink)

    Hi there,

    When I place a readonly RadRichTextBoxes as template inside a RadCarousel and the focus is on the RadRichTextBox, the scroll wheel scrolls RadCarousel instead of the content inside the RadRichTextBox.  When I put a FlowDocumentViewer in place of the RadRichTextBox,  the scroll wheel scrolls correctly.  Is there a workaround for this?

    Thanks
    Haifeng 

    Reply

  • Iva Toteva Iva Toteva admin's avatar

    Posted on Oct 10, 2011 (permalink)

    Hello Haifeng,

    The problem occurs because RadRichTextBox does not handle the MouseWheel event when the value of the VerticalScrollBar changes. We will consider implementing this functionality in the future.

    You can workaround this issue by handling the mouse wheel event whenever needed. Provided that you have subscribed to the Loaded and Unloaded event of the RadRichTextBox in the DataTemplate of the RadCarousel, you can do that as follows:

    void radRichTextBox_Loaded(object sender, RoutedEventArgs e)
    {
        RadRichTextBox richTextBox = (RadRichTextBox)sender;
        if (richTextBox.VerticalScrollBar.Visibility == Visibility.Visible)
        {
            richTextBox.MouseWheel += richTextBox_MouseWheel;
        }
    }
     
    void richTextBox_MouseWheel(object sender, MouseWheelEventArgs e)
    {
        e.Handled = true;
    }
     
    private void radRichTextBox_Unloaded(object sender, RoutedEventArgs e)
    {
        RadRichTextBox richTextBox = (RadRichTextBox)sender;
        richTextBox.MouseWheel -= richTextBox_MouseWheel;
    }

    I hope this helps.  Best wishes,
    Iva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Haifeng avatar

    Posted on Oct 18, 2011 (permalink)

    You guys are awesome!

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Carousel > Scroll wheel issue when RadRichTextBox is inside Radcarousel
Related resources for "Scroll wheel issue when RadRichTextBox is inside Radcarousel"

WPF Carousel Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]