Example #1
0
        private void loadAppearanceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Title = "Open Pivot Table Appearance file";
            string s = GetFile("default.appearance.XML");

            s = s.Substring(0, s.LastIndexOf(@"\"));
            dlg.InitialDirectory = s;
            dlg.Filter           = "Pivot Table Appearance files (*.appearance.xml)|*.appearance.xml|All files (*.*)|*.*";

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Application.DoEvents();// let the dialog close before loading schema
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    PivotAppearance appearance = PivotAppearance.LoadXML(dlg.FileName);
                    pivotGridControl1.SetAppearance(appearance);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                }
            }
        }
Example #2
0
        private void showAllColorsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //show all colors - just for illustration to allow you to see what Appearance property affects what part of the pivotCOntrol1.MainDisplayGrid.
            PivotAppearance appearance = pivotGridControl1.GetAppearance();

            appearance.RowTotalCell.BackColor        = Color.Gold;
            appearance.RowExpandCell.BackColor       = Color.Blue;
            appearance.ColumnExpandCell.BackColor    = Color.Red;
            appearance.RowCell.BackColor             = Color.Pink;
            appearance.ValueCell.BackColor           = Color.LemonChiffon;
            appearance.ColumnTotalCell.BackColor     = Color.IndianRed;
            appearance.ColumnCell.BackColor          = Color.LawnGreen;
            appearance.CalculationNameCell.BackColor = Color.Yellow;
            appearance.TopLeftCell.BackColor         = Color.Turquoise;

            pivotGridControl1.UpdateValues(); //forces a refresh to display new appearance
        }