CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Jun 2008
    Posts
    1

    PrintPreview/ Print datagrid in MDI

    Hi Guys,
    I have some MDI C# project.
    The "main" window opens childs:

    Code:
                SomeType1 childForm = new SomeType1;
                childForm.MdiParent = this;
                childForm.Show();
    
    	...
    
                SomeType2 childForm = new SomeType2;
                childForm.MdiParent = this;
                childForm.Show();
    ...

    Each "childForm" has its own DataGrid placed on it.
    I need to implement print preview / print functionality.

    I've placed some stuff like this:

    Code:
            private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
            {
                Form activeChild = this.ActiveMdiChild;
                printPreviewDialog1.ShowDialog(activeChild);
            }
    But preview dialog is empty...

    How to do it?
    Thanks in advance.
    Last edited by HanneSThEGreaT; June 12th, 2008 at 04:19 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured