public DataGridViewSummary()
        {
            InitializeComponent();

            refBox     = new TextBox();
            panel      = new Panel();
            spacePanel = new Panel();
            hScrollBar = new HScrollBar();

            summaryControl = new SummaryControlContainer(this);
            summaryControl.VisibilityChanged += new EventHandler(summaryControl_VisibilityChanged);

            Resize += new EventHandler(DataGridControlSum_Resize);
            RowHeadersWidthChanged += new EventHandler(DataGridControlSum_Resize);
            ColumnAdded            += new DataGridViewColumnEventHandler(DataGridControlSum_ColumnAdded);
            ColumnRemoved          += new DataGridViewColumnEventHandler(DataGridControlSum_ColumnRemoved);

            hScrollBar.Scroll         += new ScrollEventHandler(hScrollBar_Scroll);
            hScrollBar.VisibleChanged += new EventHandler(hScrollBar_VisibleChanged);

            hScrollBar.Top    += summaryControl.Bottom;
            hScrollBar.Minimum = 0;
            hScrollBar.Maximum = 0;
            hScrollBar.Value   = 0;
        }
示例#2
0
        public DataGridViewSummary()
        {
            InitializeComponent();
            firstBind                = true;
            listColumnsWidth         = new List <int>();
            refBox                   = new TextBox();
            lbscrollx                = new Label();
            headerCheckBox           = new CheckBox();
            headerCheckBox.Size      = new Size(15, 15);
            headerCheckBox.BackColor = Color.Transparent;
            // headerCheckBox.BackColor = Color.Red;
            headerCheckBox.Text = "";
            panel      = new Panel();
            spacePanel = new Panel();
            hScrollBar = new HScrollBar();
            //  refBox.Font = new Font(FontFamily.GenericMonospace, 20);
            summaryControl = new SummaryControlContainer(this);
            summaryControl.VisibilityChanged += new EventHandler(summaryControl_VisibilityChanged);


            DataSourceChanged += DataGridViewSummary_DataSourceChanged;
            // CellPainting += DataGridViewSummary_CellPainting;
            Resize += new EventHandler(DataGridControlSum_Resize);
            RowHeadersWidthChanged += new EventHandler(DataGridControlSum_Resize);
            //   ColumnAdded += new DataGridViewColumnEventHandler(DataGridControlSum_ColumnAdded);
            //  ColumnRemoved += new DataGridViewColumnEventHandler(DataGridControlSum_ColumnRemoved);


            hScrollBar.Scroll         += new ScrollEventHandler(hScrollBar_Scroll);
            hScrollBar.VisibleChanged += new EventHandler(hScrollBar_VisibleChanged);

            headerCheckBox.Click += HeaderCheckBox_Click;

            AllowUserToAddRows          = false;
            BackgroundColor             = Color.WhiteSmoke;
            RowHeadersWidthSizeMode     = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
            summaryValue = new Dictionary <string, string>();
        }