This is a migrated thread and some comments may be shown as answers.

Scroll wheel issue when RadRichTextBox is inside Radcarousel

2 Answers 196 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Haifeng
Top achievements
Rank 1
Haifeng asked on 06 Oct 2011, 03:17 AM
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 

2 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 10 Oct 2011, 05:04 PM
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 >>

0
Haifeng
Top achievements
Rank 1
answered on 18 Oct 2011, 11:06 PM
You guys are awesome!
Tags
Carousel
Asked by
Haifeng
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Haifeng
Top achievements
Rank 1
Share this question
or