private void _btnPrintGrids_Click(object sender, RoutedEventArgs e)
        {
            var pd = new PrintDialog();

            if (pd.ShowDialog().Value)
            {
                // get margins, scale mode
                var margin =
                    _cmbMargins.SelectedIndex == 0 ? 96.0 / 4 :
                    _cmbMargins.SelectedIndex == 1 ? 96.0 / 2 :
                    96.0;
                var scaleMode =
                    _cmbZoom.SelectedIndex == 0 ? ScaleMode.ActualSize :
                    _cmbZoom.SelectedIndex == 1 ? ScaleMode.PageWidth :
                    ScaleMode.SinglePage;

                // calculate page size
                var sz = new Size(pd.PrintableAreaWidth, pd.PrintableAreaHeight);

                // create paginator
                var paginator = new FlexPaginator(_flex, scaleMode, sz, new Thickness(margin), 100);
                paginator.AddPages(_flex2);
                pd.PrintDocument(paginator, "C1FlexGrid printing example");
            }
        }
Exemplo n.º 2
0
        private void _btnPrintGrids_Click(object sender, RoutedEventArgs e)
        {
            var pd = new PrintDialog();
            if (pd.ShowDialog().Value)
            {
                // get margins, scale mode
                var margin =
                    _cmbMargins.SelectedIndex == 0 ? 96.0 / 4 :
                    _cmbMargins.SelectedIndex == 1 ? 96.0 / 2 :
                    96.0;
                var scaleMode =
                    _cmbZoom.SelectedIndex == 0 ? ScaleMode.ActualSize :
                    _cmbZoom.SelectedIndex == 1 ? ScaleMode.PageWidth :
                    ScaleMode.SinglePage;

                // calculate page size
                var sz = new Size(pd.PrintableAreaWidth, pd.PrintableAreaHeight);

                // create paginator
                var paginator = new FlexPaginator(_flex, scaleMode, sz, new Thickness(margin), 100);
                paginator.AddPages(_flex2);
                pd.PrintDocument(paginator, "C1FlexGrid printing example");
            }
        }