Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Print only contents of grid?
posted

Hello,

  I am new to printing with the UltraGrid, UltraGridPrintDocument, etc... It's very easy to setup the basics, however I see that when printed, the entire grid is printed and occupies the entire page.  Is it possible to simply print the rows and columns of the grid without any background or border stuff?

 

Thanks,

  Matt

Parents
No Data
Reply
  • 3707
    posted

    One way to get rid of the border is to set the BorderStyleCell property before printing, and then change it back afterwards. I'm not sure if this is the most efficient way since I haven't had to do this same exact thing, but it does work.

    ultraGridPrintDocument1.FitWidthToPages = 1;
    ultraGrid1.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.None;
    ultraPrintPreviewDialog1.ShowDialog(this);
    ultraGrid1.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.Solid;

    And if you're using an ISL file for styling, you'd can do it this way.

    ultraGridPrintDocument1.FitWidthToPages = 1;
    ultraGrid1.StyleLibraryName = "";
    ultraGrid1.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.None;
    ultraPrintPreviewDialog1.ShowDialog(this);
    ultraGrid1.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.Solid;
    ultraGrid1.StyleLibraryName = "YourStyleLibraryName";

    If there's a better way, I'm sure the Infragistics Team will chime in.

Children