///<summary>
 /// Constructs a new instance of a <see cref="EditableGridControlVWG"/>.
 ///</summary>
 ///<param name="controlFactory">The <see cref="IControlFactory"/> to use to construct the control.</param>
 public EditableGridControlVWG(IControlFactory controlFactory)
 {
     if (controlFactory == null) throw new HabaneroArgumentException("controlFactory", 
             "Cannot create an editable grid control if the control factory is null");
     _controlFactory = controlFactory;
     _grid = _controlFactory.CreateEditableGrid();
     _editableGridManager = new EditableGridControlManager(this, controlFactory);
     Buttons = _controlFactory.CreateEditableGridButtonsControl();
     FilterControl = _controlFactory.CreateFilterControl();
     InitialiseButtons();
     InitialiseFilterControl();
     BorderLayoutManager manager = controlFactory.CreateBorderLayoutManager(this);
     manager.AddControl(FilterControl, BorderLayoutManager.Position.North);
     manager.AddControl(_grid, BorderLayoutManager.Position.Centre);
     manager.AddControl(Buttons, BorderLayoutManager.Position.South);
     this.Grid.BusinessObjectSelected += Grid_OnBusinessObjectSelected;
     this.AllowUsersToAddBO = true;
 }
Esempio n. 2
0
        ///<summary>
        /// Constructs a new instance of a <see cref="EditableGridControlVWG"/>.
        ///</summary>
        ///<param name="controlFactory">The <see cref="IControlFactory"/> to use to construct the control.</param>
        public EditableGridControlVWG(IControlFactory controlFactory)
        {
            if (controlFactory == null)
            {
                throw new HabaneroArgumentException("controlFactory",
                                                    "Cannot create an editable grid control if the control factory is null");
            }
            _controlFactory      = controlFactory;
            _grid                = _controlFactory.CreateEditableGrid();
            _editableGridManager = new EditableGridControlManager(this, controlFactory);
            Buttons              = _controlFactory.CreateEditableGridButtonsControl();
            FilterControl        = _controlFactory.CreateFilterControl();
            InitialiseButtons();
            InitialiseFilterControl();
            BorderLayoutManager manager = controlFactory.CreateBorderLayoutManager(this);

            manager.AddControl(FilterControl, BorderLayoutManager.Position.North);
            manager.AddControl(_grid, BorderLayoutManager.Position.Centre);
            manager.AddControl(Buttons, BorderLayoutManager.Position.South);
            this.Grid.BusinessObjectSelected += Grid_OnBusinessObjectSelected;
            this.AllowUsersToAddBO            = true;
        }