in my application I use a RadCarousel. When I click on my document RadButton, I open a PDF document with 2 pages, I extract each page as an image, after each image extraction, I the add the new created image into my RadCarousel and I call the following method:
to have the first page ont top. The 2nd page in my carousel sill white (empty) until I scroll the 2nd page ouside the carousel view and bring it back into th carousel view, at this time I can see the 2nd page content.
8 Answers, 1 is accepted
In order to suggest any further, I would need a bit more information about your exact scenario. Will it be possible to share more details on it and some relevant code snippets illustrating what you do ?
the Telerik team
the flow is going like this:
- I have a grid with data
- The user have to select one row and click on the "Show document" button
- I start a thread that make a call to my backend to receive the PDF document (document can have one or 2 pages)
- When receive is completed, I start another thread to extract each page of the document and transform it into an "Image"
- For each new created image, I add it to my carousel (see code snippet at the end)
- With a 1 page document, fine, no problem.
- With a 2 pages document, I see the first page with is content but the second page was empty and white.
- I scroll the 2nd page outsite the visible area of the carousel and I bring it back into the visible area of the carousel and now, I can see the content of the 2nd page.
private void delayedPdfToImageConverter(object pPdf)
if (mCarouselToUseDuringDocsThread != null && pPdf != null)
var img = pPdf as InterDependencyImage;
img.Image = new Image();
img.Image.Source = img.Frame;
if (mCarouselToUseDuringDocsThread.Items.Count > 0)
if (mCarouselToUseDuringDocsThread.Items.Count == 1)
// Validate if it's a new document.
if (mCarouselToUseDuringDocsThread == SignCtxDocsCarousel)
mSignCtxNewIncomingDoc = true;
mUnsignCtxNewIncomingDoc = true;
// Bring the first received image on top.
I have tried to reproduce the issue you reported, but unfortunately without any success. Could you verify whether the second image is created once it should be displayed ? Could you try displaying simple images, instead of such converted from pdf just to check whether the problem is with the timing ? How do you add each of those images to the source of the carousel ?
the Telerik team
Could you verify whether the second image is created once it should be displayed ?
Could you try displaying simple images, instead of such converted from pdf just to check whether the problem is with the timing ?
All images I show in my carousel comes from a PDF document. If I have 2 documents with 1 page each, all pages are displayed correctly. The problem occured only when I have a PDF document with 2 pages. What I did exactly is, a person can have 1 or more document with one or multiple plages for each document. In my carousel, I have to display all document pages.
How do you add each of those images to the source of the carousel ?
We still are not able to reproduce the issue on our side. Would it be possible to send a sample project that demonstrates the false behavior so we can debug it on our side, in order to provide further assistance?
Looking forward to your response!
the Telerik team
I think that my problem has the same cause as this problem.
I am using a RadCarousel, with ItemTemplate x.
The ItemTemplate x is a DataTemplate. This DataTemplate has a Border, and the Border's background color is set by a DataTrigger set in the DataTemplate.
Thus: the DataTemplate contains some DataTriggers which set the Background of the Border in the DataTemplate.
What happens is the next: in the Border I have a button. This button calls a command in my ViewModel. The ViewModel sets a property which causes the DataTriggers to change the background of the Border.
The problem is: it seems that the DataTriggers are only triggerd, after I select another Item in the Carousel.
Say f.i. that the Background is Green at the beginning, I click the button, which should set the Background to Red (with a storyboard). The color only starts to animate from Green to Red after I select another item in the carousel.
it seems that the carousel only updates items whenever some event is called.
Is there a solution/workaround for this problem? Preferably in XAML (because for requirement reasons, I cannot use too much code, except from Attached Behaviors maybe).
I had created an attached behavior for the RadCarousel, because I couldn't get my first item of the ItemsSource to be visible upon start of my application.
The attached behavior is coded as below:
Whenever this method is called, the DataTriggers in my ItemTemplate are executed. However, they are executed over and over again. Say f.i. that the DataTrigger changes the background from green to orange, then everytime this code is called, the background changes again from green to orange. If I would skip the code (breakpoint + skip these two lines), then nothing is updated. Even those who actually would have to change from green to orange, don't.
I really don't understand how the RadCarousel is set up to update any layouts or start datatriggers, but I would have expected this to be independent from the RadCarousel.
Could you open a support ticket and attach the project there so we can debug it on our side and see what's wrong?
Looking forward to hearing from you.
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.