예제 #1
0
        public GridView()
        {
            Size = new Point(100, 100);

            Columns                     = new GridColumnCollection();
            Columns.ItemAdded          += Columns_OnAdd;
            Columns.ItemRemoved        += Columns_OnRemove;
            Columns.BeforeItemRemoved  += Columns_BeforeItemRemoved;
            Columns.BeforeItemAdded    += Columns_BeforeItemAdded;
            Columns.BeforeItemsCleared += Columns_BeforeItemsCleared;

            Items                     = new GridViewItemCollection();
            Items.ItemAdded          += Items_OnAdd;
            Items.ItemRemoved        += Items_OnRemove;
            Items.BeforeItemsCleared += Items_BeforeItemsCleared;
            Items.ItemsSorted        += Items_ItemsSorted;

            Header      = new Frame();
            Header.Size = new Point(20, 32);
            Header.Dock = DockStyle.Top;
            Elements.Add(Header);

            _headerContainer          = new Frame();
            _headerContainer.Size     = new Point(20, 32);
            _headerContainer.AutoSize = AutoSize.Horizontal;
            Header.Controls.Add(_headerContainer);

            _panel                  = new Panel();
            _panel.Dock             = DockStyle.Fill;
            _panel.Content.AutoSize = AutoSize.HorizontalVertical;

            _panel.VScroll.ButtonUp.Visible   = false;
            _panel.VScroll.ButtonDown.Visible = false;
            _panel.VScroll.Size                = new Point(13, 12);
            _panel.VScroll.Slider.Style        = "vscrollTrack";
            _panel.VScroll.Slider.Button.Style = "vscrollButton";
            _panel.VScroll.Dock                = DockStyle.Right;
            _panel.VScroll.Margin              = new Margin(4, 0, 0, 0);

            _panel.HScroll.ButtonUp.Visible   = false;
            _panel.HScroll.ButtonDown.Visible = false;
            _panel.HScroll.Size                = new Point(13, 12);
            _panel.HScroll.Slider.Style        = "vscrollTrack";
            _panel.HScroll.Slider.Button.Style = "vscrollButton";
            _panel.HScroll.Margin              = new Margin(0, 4, 0, 0);
            _panel.Content.Update             += Content_OnControlUpdate;
            Elements.Add(_panel);
        }