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

Extra Scroll Bars When Printing RadDiagram

4 Answers 105 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 07 May 2013, 09:14 PM
I have a collection of RadDiagram items I need to print out on a single page.
I also need to preview it in a View.
I have placed my RadDiagram items in cells in a Grid for each page and I want to print.
Everything works great when viewing this in a XAML view.

For printing, I take the collection of Grids (pages) and create a FixedPage for each Grid (page) and a FixedDocument to contain all
the pages.
I then use PrintDialog's PrintDocument() method.
I can't use Telerik's Printing utilities as they support only one RadDiagram and no layout.

If the size (Width & Height) of my RadDiagram is less than or equal to the size of the Grid cell,
I get an extra Scroll bar on the right and bottom sides of each RadDiagram on the page.
As I'm not embedding the RadDiagram inside of a ScrollViewer and I don't see these scroll bars when I view it on the screen,
I don't know where this is coming from.

To prove it is RadDiagram causing this, I have substituted a simple Rectangle control in place of the RadDiagram and the 
scroll bars go away.  I have also tried an empty RadDiagram and I also get the scroll bars.

I have attached a picture of one RadDiagram in a Grid being viewed and the same Grid being printed to show the scroll bars.

My questions are:
  * Why am I getting the scroll bars?
  * How do I turn them off?

Thanks,
 Alan

4 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 10 May 2013, 12:59 PM
Hi Alan,

In order to hide the ScrollBars of the RadDiagram control you can set these attached properties properties:

<telerik:RadDiagram ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" />
If this approach is not working in your scenario. We will need more information about your scenario in order to make any other suggestion. More specifically, we will need you to specify what you have in mind when you say "I have placed my RadDiagram items in cells in a Grid for each page"? Please note that the RadDiagramItems are designed to be used only under the domain of the RadDiagram framework, only.

Are you saying that you have a Grid with several Rows and you have defined a RadDiagram in each row? If so can you please clarify why you need to use several RadDiagrams and external (for the control) printing logic while you can use only one in combination with our build-in Printing logic.

However, it will be best if you can send us a sample project where we can reproduce this behavior on our side. By doing so we will be able to fully understand your scenario (understand why you get those ScrollBars) and suggest the best approach in your case.

Regards,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Alan
Top achievements
Rank 1
answered on 10 May 2013, 04:08 PM
Pavel,

Thanks for the quick reply. I will try out your suggestion.

Some more information on what I am doing:
   Yes, I have a Grid with several rows and columns of RadDiagram items.
    This RadDiagram items are generated from different data and are gathered together into one Grid control.
    I am also placing some other WPF controls in to the same grid for decoration.
    This works great when I view the control in a View on the screen (no scroll bars).

    The scroll bars only appear when I print & only with the RadDiagram controls, not the other controls.

Some more questions:
   * Are you embedding the RadDiagram inside of a ScrollViewer already?
   * What Windows calls are you using to print RadDiagram inside of your control?

Thanks,
   Alan
0
Alan
Top achievements
Rank 1
answered on 10 May 2013, 04:42 PM
Pavel,

I have tried your fix and it doesn't seem to effect whether I see scroll bars are not on print.
I have also tried it with empty RadDiagram and see the same problem.  Here is how I am doing it:
                var radDiagram = new RadDiagram();
                radDiagram.Width = label.Size.Width;
                radDiagram.Height = label.Size.Height;
                var hViz = ScrollViewer.GetHorizontalScrollBarVisibility(radDiagram);
                var vViz = ScrollViewer.GetVerticalScrollBarVisibility(radDiagram);
                Console.WriteLine("RadDiagram before: hViz:{0} vViz:{1}", hViz, vViz);
                ScrollViewer.SetHorizontalScrollBarVisibility(radDiagram, ScrollBarVisibility.Hidden);
                ScrollViewer.SetVerticalScrollBarVisibility(radDiagram, ScrollBarVisibility.Hidden);
                hViz = ScrollViewer.GetHorizontalScrollBarVisibility(radDiagram);
                vViz = ScrollViewer.GetVerticalScrollBarVisibility(radDiagram);
                Console.WriteLine("RadDiagram after: hViz:{0} vViz:{1}", hViz, vViz);

They print out like:
RadDiagram before: hViz:Disabled vViz:Visible
RadDiagram after: hViz:Hidden vViz:Hidden

Any other suggestions? 

Alan
0
Hristo
Telerik team
answered on 15 May 2013, 01:42 PM
Hello Alan,

I am not sure I got your case correctly, more precisely, I am not sure what is your RadDiagram setup and how do you print the shapes. Could you please take a look at the sample project and modify it in order to simulate the issue you are experiencing? This would be the best and fastest way to assist you.

Also, I have modified the type of this thread to general feedback so you could be able to attach files.
I am looking forward to hearing from you.

Greetings,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Diagram
Asked by
Alan
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Alan
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or