コード例 #1
0
        private void SetUpGrid()
        {
            grdApplicationStatuses.AddCheckBoxColumn("", FApplicantStatusTable.Columns["Is Selected"], 17, false);
            grdApplicationStatuses.AddTextColumn(Catalog.GetString("Applicant Status Code"), FApplicantStatusTable.ColumnCode);
            grdApplicationStatuses.AddTextColumn(Catalog.GetString("Description"), FApplicantStatusTable.ColumnDescription);

            FApplicantStatusTable.DefaultView.AllowNew    = false;
            FApplicantStatusTable.DefaultView.AllowEdit   = true;
            FApplicantStatusTable.DefaultView.AllowDelete = false;

            grdApplicationStatuses.DataSource = new DevAge.ComponentModel.BoundDataView(FApplicantStatusTable.DefaultView);

            // check boxes by mouse click anywhere on a row, spacebar or enter key
            grdApplicationStatuses.MouseClick      += new MouseEventHandler(this.GrdApplicationStatuses_Click);
            grdApplicationStatuses.SpaceKeyPressed += new TKeyPressedEventHandler(this.GrdApplicationStatuses_SpaceKeyPressed);
            grdApplicationStatuses.EnterKeyPressed += new TKeyPressedEventHandler(this.GrdApplicationStatuses_EnterKeyPressed);

            // This is neccessary to counteract the grid automatically checking a box when the user clicks on the checkbox column.
            // We do not want this to happen as the box is also checked by the MouseEventHandler.
            FGridValueChangedEvent = new CustomValueChangedEvent(this);
            grdApplicationStatuses.Controller.AddController(FGridValueChangedEvent);
            ChangedRowEvent += new CheckChangedArgs(ChangeCheckedStateForRow);

            grdApplicationStatuses.AutoSizeCells();
        }
コード例 #2
0
        private void SetUpGrid()
        {
            grdApplicationStatuses.AddCheckBoxColumn("", FApplicantStatusTable.Columns["Is Selected"], 17, false);
            grdApplicationStatuses.AddTextColumn(Catalog.GetString("Applicant Status Code"), FApplicantStatusTable.ColumnCode);
            grdApplicationStatuses.AddTextColumn(Catalog.GetString("Description"), FApplicantStatusTable.ColumnDescription);

            FApplicantStatusTable.DefaultView.AllowNew = false;
            FApplicantStatusTable.DefaultView.AllowEdit = true;
            FApplicantStatusTable.DefaultView.AllowDelete = false;

            grdApplicationStatuses.DataSource = new DevAge.ComponentModel.BoundDataView(FApplicantStatusTable.DefaultView);

            // check boxes by mouse click anywhere on a row, spacebar or enter key
            grdApplicationStatuses.MouseClick += new MouseEventHandler(this.GrdApplicationStatuses_Click);
            grdApplicationStatuses.SpaceKeyPressed += new TKeyPressedEventHandler(this.GrdApplicationStatuses_SpaceKeyPressed);
            grdApplicationStatuses.EnterKeyPressed += new TKeyPressedEventHandler(this.GrdApplicationStatuses_EnterKeyPressed);

            // This is neccessary to counteract the grid automatically checking a box when the user clicks on the checkbox column.
            // We do not want this to happen as the box is also checked by the MouseEventHandler.
            FGridValueChangedEvent = new CustomValueChangedEvent(this);
            grdApplicationStatuses.Controller.AddController(FGridValueChangedEvent);
            ChangedRowEvent += new CheckChangedArgs(ChangeCheckedStateForRow);

            grdApplicationStatuses.AutoSizeCells();
        }