Hi,
I have problems for removing the border lines in my tree print.Do someone know witch property must be setted for a result without visible borders ?
Thanks
Thank you for posting in our forums.
What you can do in order to achieve this is to handle the InitializeTree event of the UltraPrint document and set the BorderStyle of the printed control to None:
private void ultraTreePrintDocument1_InitializeTree(object sender, Infragistics.Win.UltraWinTree.Printing.InitializeTreeEventArgs e)
{
e.Control.BorderStyle = Infragistics.Win.UIElementBorderStyle.None;
}
This way the tree will be printed without borders. Also note that this change will not affect the actual UltraTree on your form. It will keep it border style.
I am looking forward to hearing from you.
Ok, thank you for the advice.I'll try that and I'll let you know.
Regards
Thank you for the update.
Let me know if this suggestion resolves your issue when you are able to test this.
I am looking forward to your reply.
I Have tried your example in my program but it doesn't work.
The event method is good launched but the borders are not removed.
I see further.
Here is my program to see if I have done something wrong :
public void PrintPreview(UltraTree tree) { using (var printDoc = new UltraTreePrintDocument()) {
printDoc.InitializeTree += printDoc_InitializeTree;
printDoc.Tree = tree;
using (var previewDialog = new UltraPrintPreviewDialog())
{ previewDialog.Document = printDoc; previewDialog.ShowDialog(); }
} }
private void printDoc_InitializeTree(object sender, Infragistics.Win.UltraWinTree.Printing.InitializeTreeEventArgs e) { e.Control.BorderStyle = Infragistics.Win.UIElementBorderStyle.None; }
Thank you for the reply.
What version are you using? I tested this code and everything is working properly for me. I am attaching the sample I used to test this with version 15.1. Please run it and let me know if the borders are removed. If they are, please modify the sample so that it has the same behavior as in your case (the borders aren’t removed even though you are handling the InitializeTree event).
I have tested your sample and it works by me too.
It's seems to be exactly the same code as by me but I will see it again.
It works finally!!I have enter this code so as you said and the borders have disappeared :
private void printDoc_InitializeTree(object sender, InitializeTreeEventArgs e) { e.Control.ImageList = _tree.ImageList; e.Control.UseAppStyling = false; e.Control.BorderStyle = Infragistics.Win.UIElementBorderStyle.None; }
Thank you veruy much for all your help.
In AppStylist there is a property for each component called ResolutionOrder. With this property you can control if the settings set on the control or the settings set in AppStylist have precedence. If for the UltraTree this property is set to ControlThanApplication then the settings that are set on the control will have precedence and the suggestion I gave you will work. In order to set it go to the Navigation tab, hover the UltraTree and press “C” when the tooltip pops up. Then you can find the property in the Property Grid in the bottom right.
Please let me know if you have any additional questions.
Yes, you're right, we are using many times this instruction in our application, the problem must come from there.
This therefore means that we can not do anything else for removing the borders?
The BorderStyle might be overridden by an isl. Are you loading a Style Library into your application? Check for "StyleManager.Load" in your code if you are not sure.