public SelectionDependentCommand(RadSpreadsheet radSpreadsheet, Action <object> action, Predicate <object> predicate)
            : base(action, predicate)
        {
            this.radSpreadsheet = radSpreadsheet;

            this.radSpreadsheet.ActiveSheetEditorChanged += this.RadSpreadsheetActiveSheetEditorChanged;
        }
 public static PrintPreviewControl CreatePrintPreviewControl(RadSpreadsheet spreadsheet)
 {
     return new PrintPreviewControl()
     {
         RadSpreadsheet = spreadsheet
     };
 }
Ejemplo n.º 3
0
 private static PrintPreviewControl CreatePrintPreviewControl(RadSpreadsheet spreadsheet)
 {
     return(new PrintPreviewControl()
     {
         RadSpreadsheet = spreadsheet
     });
 }
        public SelectionDependentCommand(RadSpreadsheet radSpreadsheet, Action<object> action, Predicate<object> predicate)
            : base(action, predicate)
        {
            this.radSpreadsheet = radSpreadsheet;

            this.radSpreadsheet.ActiveSheetEditorChanged += this.RadSpreadsheetActiveSheetEditorChanged;
        }
        public static void PrintPreview(this RadGridView grid)
        {
            spreadsheet = CreateSpreadsheet(grid);
            var printPreviewControl = CreatePrintPreviewControl(spreadsheet);
            var window = CreatePreviewWindow(spreadsheet, printPreviewControl);

            window.ShowDialog();
        }
Ejemplo n.º 6
0
        public static void PrintPreview(this RadGridView grid)
        {
            spreadsheet = CreateSpreadsheet(grid);
            var printPreviewControl = CreatePrintPreviewControl(spreadsheet);
            var window = CreatePreviewWindow(spreadsheet, printPreviewControl);

            window.ShowDialog();
        }
Ejemplo n.º 7
0
        private static void OnWorkbookChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RadSpreadsheet spreadsheet = d as RadSpreadsheet;

            if (spreadsheet != null)
            {
                spreadsheet.Workbook = (Workbook)e.NewValue;
            }
        }
Ejemplo n.º 8
0
 internal static void LoadSpreadsheet()
 {
     spreadsheet = new RadSpreadsheet();
     window      = new RadWindow()
     {
         Width = 0, Height = 0, Opacity = 0, Content = spreadsheet
     };
     window.Show();
 }
Ejemplo n.º 9
0
        private void Import()
        {
            RadSpreadsheet radSpreadsheet = new RadSpreadsheet();
            var            editor         = radSpreadsheet.ActiveWorksheetEditor;

            #region radspreadprocessing-formats-and-conversion-workbookformatprovidersmanager_2
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = FileDialogsHelper.GetOpenFileDialogFilter();
            if (openFileDialog.ShowDialog() == true)
            {
                try
                {
                    string extension = Path.GetExtension(openFileDialog.SafeFileName);
                    using (Stream input = openFileDialog.OpenFile())
                    {
                        editor.Owner.Workbook = WorkbookFormatProvidersManager.Import(extension, input);
                    }
                }
                catch (IOException ex)
                {
                    throw new IOException("The file cannot be opened. It might be locked by another application.", ex);
                }
            }
            #endregion

#if silverlight
            #region radspreadprocessing-formats-and-conversion-workbookformatprovidersmanager_4
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = FileDialogsHelper.GetOpenFileDialogFilter();
            if (openFileDialog.ShowDialog() == true)
            {
                try
                {
                    string extension = Path.GetExtension(openFileDialog.File.Name);
                    using (Stream input = openFileDialog.File.OpenRead())
                    {
                        editor.Owner.Workbook = WorkbookFormatProvidersManager.Import(extension, input);
                    }
                }
                catch (IOException ex)
                {
                    throw new IOException("The file cannot be opened. It might be locked by another application.", ex);
                }
            }
            #endregion
#endif
        }
Ejemplo n.º 10
0
        private void ExportCsvCustomDelimiter()
        {
            RadSpreadsheet radSpreadsheet = new RadSpreadsheet();
            var            editor         = radSpreadsheet.ActiveWorksheetEditor;

            #region radspreadprocessing-formats-and-conversion-workbookformatprovidersmanager_3
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.Filter = FileDialogsHelper.GetSaveFileDialogFilter();

            if (saveFileDialog.ShowDialog() == true)
            {
                string extension = Path.GetExtension(saveFileDialog.SafeFileName);
                using (Stream output = saveFileDialog.OpenFile())
                {
                    WorkbookFormatProvidersManager.Export(editor.Owner.Workbook, extension, output);
                }
            }

            #endregion
        }
Ejemplo n.º 11
0
        protected virtual void PrintButton_Click(object sender, EventArgs e)
        {
            if (this.gridControl.MasterViewInfo.IsWaiting)
            {
                RadMessageBox.Show("The Data is not loaded! Please wait!");
                return;
            }

            var spreadsheet = new RadSpreadsheet();
            var window      = new Form()
            {
                Width = 0, Height = 0, Opacity = 0
            };

            spreadsheet.Parent = window;
            window.Show();
            spreadsheet.Workbook = CreateWorkbook();
            spreadsheet.Print(new PrintWhatSettings(ExportWhat.ActiveSheet, false));
            window.Close();
        }
Ejemplo n.º 12
0
 public CustomLayersBuilder(RadSpreadsheet radSpreadsheet)
 {
     this.radSpreadsheet = radSpreadsheet;
 }
Ejemplo n.º 13
0
 public CustomCellEditUILayer(RadSpreadsheet sheet)
 {
     this.ContainerManager.UILayerContainer.IsHitTestVisible = true;
 }
		internal static void LoadSpreadsheet()
		{
			spreadsheet = new RadSpreadsheet();
			window = new RadWindow() { Width = 0, Height = 0, Opacity = 0, Content = spreadsheet };
			window.Show();
		}