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
705
How can I handle the print button event which located in UltraWinGrid.PrintPreview() method?
posted

Hi,

I have a print preview button under a search result ultraGrid. I want to print preview and print only the selected records in the ultraGrid.

I've achieved this in print preview, by adding following codes in the InitializePrintPreview event:

private void searchResultGrid_InitializePrintPreview(object sender, CancelablePrintPreviewEventArgs e)
        {
            // Hide the checkbox column
            e.PrintLayout.Bands[0].Columns["Select"].Hidden = true;

            // Filter unselected records for printing.
            foreach (UltraGridRow row in e.PrintLayout.Rows)
            {
                if (row == null) continue;
                if (row.Cells == null) continue;

                if (row.Cells["Select"].Text.ToLower().Equals("false")) row.Hidden = true;
            }
        }

Now the problem is, when I click the PRINT button on the Print Preview form, it still prints all the search result records.

so can anyone help me to filter the unselected records when click on PRINT button?

Thanks,

Nan

Parents
No Data
Reply Children
No Data