Inheritance: SourceGrid.Cells.Editors.EditorControlBase
        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="AGrid"></param>
        /// <param name="ASourceTable"></param>
        public void CreateColumns(TSgrdDataGrid AGrid, PFoundationDeadlineTable ASourceTable)
        {
            SourceGrid.Cells.Editors.ComboBox       FMonthEditor;
            SourceGrid.Cells.Editors.TextBoxNumeric FDayEditor;
            Int32[]  MonthDropDownValues;
            String[] MonthDropDownDisplayValues;
            DevAge.ComponentModel.Validator.ValueMapping MonthDropDownMapping;

            // Set up Month ComboBox editor
            MonthDropDownValues = new Int32[] {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
            };
            MonthDropDownDisplayValues = new String[] {
                "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST",
                "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"
            };
            FMonthEditor = new SourceGrid.Cells.Editors.ComboBox(typeof(Int32), MonthDropDownValues, true);
            FMonthEditor.Control.FormattingEnabled = true;
            MonthDropDownMapping             = new DevAge.ComponentModel.Validator.ValueMapping();
            MonthDropDownMapping.SpecialType = typeof(String);
            MonthDropDownMapping.SpecialList = MonthDropDownDisplayValues;
            MonthDropDownMapping.ValueList   = MonthDropDownValues;
            MonthDropDownMapping.BindValidator(FMonthEditor);
            FMonthEditor.EditableMode = EditableMode.Focus;

            FDayEditor = new SourceGrid.Cells.Editors.TextBoxNumeric(typeof(Int32));
            FDayEditor.EditableMode = EditableMode.Focus;

            AGrid.AddTextColumn("Month", ASourceTable.ColumnDeadlineMonth, 80, FMonthEditor);
            AGrid.AddTextColumn("Day", ASourceTable.ColumnDeadlineDay, -1, FDayEditor);

            // Hook up editor events
            FDayEditor.Control.Validating   += new System.ComponentModel.CancelEventHandler(Day_Validating);
            FMonthEditor.Control.Validating += new System.ComponentModel.CancelEventHandler(Month_Validating);
        }
 /// <summary>
 /// todoComment
 /// </summary>
 /// <param name="AGrid"></param>
 /// <param name="ASourceTable"></param>
 public void CreateColumns(TSgrdDataGrid AGrid, PFoundationProposalDetailTable ASourceTable)
 {
     SourceGrid.Cells.Editors.ComboBox      ProjectEditor;
     SourceGrid.Cells.Editors.TextBoxButton MinistryEditor;
     ProjectEditor = new SourceGrid.Cells.Editors.ComboBox(typeof(String));
     ProjectEditor.EditableMode  = EditableMode.Focus;
     MinistryEditor              = new SourceGrid.Cells.Editors.TextBoxButton(typeof(Int64));
     MinistryEditor.EditableMode = EditableMode.Focus;
     AGrid.AddTextColumn("Projects", ASourceTable.ColumnProjectMotivationDetail, -1, ProjectEditor);
     AGrid.AddTextColumn("Key Ministries", ASourceTable.ColumnKeyMinistryKey, -1, MinistryEditor);
     AGrid.AddTextColumn("Areas", ASourceTable.ColumnAreaPartnerKey, -1, MinistryEditor);
     AGrid.AddTextColumn("Fields", ASourceTable.ColumnFieldPartnerKey);
 }
Exemple #3
0
        public override SourceGrid.Cells.Cell MakeDataCell()
        {
            SourceGrid.Cells.Cell             cbcell       = null;
            SourceGrid.Cells.Editors.ComboBox sharededitor = null;

            var sharededitor1 = GetSharedEditor();

            if (sharededitor1 != null)
            {
                sharededitor = sharededitor1 as SourceGrid.Cells.Editors.ComboBox;
                if (sharededitor1 == null)
                {
                    throw new Exception("Wrong shared editor type.");
                }
            }

            if (sharededitor != null)
            {
                cbcell      = new SourceGrid.Cells.Cell(GetDefaultValue(), sharededitor);
                cbcell.View = Grid.gridViewModel.dataCellModel;
                return(cbcell);
            }

            cbcell = new SourceGrid.Cells.Cell(GetDefaultValue());

            mComboBoxEditor = new SourceGrid.Cells.Editors.ComboBox(GetValueType());
            mComboBoxEditor.Control.FlatStyle = FlatStyle.Flat;
            cbcell.Editor = mComboBoxEditor;
            cbcell.View   = Grid.gridViewModel.dataCellModel;

            var list = GetListItems();

            if (list != null)
            {
                mComboBoxEditor.Control.FormattingEnabled = true;
                mComboBoxEditor.StandardValues            = list;
                ValueMapping = new ValueMappingA(mComboBoxEditor, list, "Key", "Val", this);
            }

            cbcell.Editor.AllowNull = AllowNull;

            return(cbcell);
        }
Exemple #4
0
        /// <summary>
        /// Sets the order of colums
        /// </summary>
        /// <returns>void</returns>
        public void CreateColumns()
        {
            SourceGrid.Cells.Editors.TextBoxUITypeEditor l_editorDt2;
            Ict.Common.TypeConverter.TDateConverter      DateTypeConverter;
            FFamilyMembersDT = FMainDS.FamilyMembers;

            // Editor for Date of Birth column (Petra Date format)
            l_editorDt2 = new SourceGrid.Cells.Editors.TextBoxUITypeEditor(typeof(DateTime));
            l_editorDt2.EditableMode = EditableMode.None;
            DateTypeConverter        = new Ict.Common.TypeConverter.TDateConverter();

            // DateTypeConverter.
            l_editorDt2.TypeConverter = DateTypeConverter;
            try
            {
                this.FDataGrid.AddTextColumn("Person Name",
                                             FFamilyMembersDT.Columns[PartnerEditTDSFamilyMembersTable.GetPartnerShortNameDBName()], -1, FSpecialCellController, null, null,
                                             null);
                this.FDataGrid.AddTextColumn("Gender",
                                             FFamilyMembersDT.Columns[PartnerEditTDSFamilyMembersTable.GetGenderDBName()], -1, FSpecialCellController, null, null, null);
                this.FDataGrid.AddTextColumn("Date of Birth",
                                             FFamilyMembersDT.Columns[PartnerEditTDSFamilyMembersTable.GetDateOfBirthDBName()], -1, FSpecialCellController, l_editorDt2, null,
                                             null);
                this.FDataGrid.AddTextColumn("Partner Key",
                                             FFamilyMembersDT.Columns[PartnerEditTDSFamilyMembersTable.GetPartnerKeyDBName()], -1, FSpecialCellController, null, null, null);
                FamilyIDDropDownValues = new Int32[] {
                    1, 2, 3, 4, 5, 6, 7, 8, 9, 0
                };
                FFamilyIDEditor = new SourceGrid.Cells.Editors.ComboBox(typeof(Int32), FamilyIDDropDownValues, false);
                this.FDataGrid.AddTextColumn("Family ID",
                                             FFamilyMembersDT.Columns[PartnerEditTDSFamilyMembersTable.GetFamilyIdDBName()], 80, FFamilyIDEditor);
                DisableEditing();
                FFamilyIDEditor.EnableEdit          = false;
                FFamilyIDEditor.Control.Validating += new CancelEventHandler(this.FamilyID_Validating);
                // DevAge.ComponentModel.Validator.ValueMapping FamilyIDDropDownMapping =
                new DevAge.ComponentModel.Validator.ValueMapping();
            }
            catch (System.NullReferenceException)
            {
            }

            // to do if no lines.
        }
 /// <summary>
 /// todoComment
 /// </summary>
 /// <param name="AGrid"></param>
 /// <param name="ASourceTable"></param>
 public void CreateColumns(TSgrdDataGrid AGrid, PFoundationProposalDetailTable ASourceTable)
 {
     SourceGrid.Cells.Editors.ComboBox ProjectEditor;
     SourceGrid.Cells.Editors.TextBoxButton MinistryEditor;
     ProjectEditor = new SourceGrid.Cells.Editors.ComboBox(typeof(String));
     ProjectEditor.EditableMode = EditableMode.Focus;
     MinistryEditor = new SourceGrid.Cells.Editors.TextBoxButton(typeof(Int64));
     MinistryEditor.EditableMode = EditableMode.Focus;
     AGrid.AddTextColumn("Projects", ASourceTable.ColumnProjectMotivationDetail, -1, ProjectEditor);
     AGrid.AddTextColumn("Key Ministries", ASourceTable.ColumnKeyMinistryKey, -1, MinistryEditor);
     AGrid.AddTextColumn("Areas", ASourceTable.ColumnAreaPartnerKey, -1, MinistryEditor);
     AGrid.AddTextColumn("Fields", ASourceTable.ColumnFieldPartnerKey);
 }
        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="AGrid"></param>
        /// <param name="ASourceTable"></param>
        public void CreateColumns(TSgrdDataGrid AGrid, PFoundationDeadlineTable ASourceTable)
        {
            SourceGrid.Cells.Editors.ComboBox FMonthEditor;
            SourceGrid.Cells.Editors.TextBoxNumeric FDayEditor;
            Int32[] MonthDropDownValues;
            String[] MonthDropDownDisplayValues;
            DevAge.ComponentModel.Validator.ValueMapping MonthDropDownMapping;

            // Set up Month ComboBox editor
            MonthDropDownValues = new Int32[] {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
            };
            MonthDropDownDisplayValues = new String[] {
                "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST",
                "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"
            };
            FMonthEditor = new SourceGrid.Cells.Editors.ComboBox(typeof(Int32), MonthDropDownValues, true);
            FMonthEditor.Control.FormattingEnabled = true;
            MonthDropDownMapping = new DevAge.ComponentModel.Validator.ValueMapping();
            MonthDropDownMapping.SpecialType = typeof(String);
            MonthDropDownMapping.SpecialList = MonthDropDownDisplayValues;
            MonthDropDownMapping.ValueList = MonthDropDownValues;
            MonthDropDownMapping.BindValidator(FMonthEditor);
            FMonthEditor.EditableMode = EditableMode.Focus;

            FDayEditor = new SourceGrid.Cells.Editors.TextBoxNumeric(typeof(Int32));
            FDayEditor.EditableMode = EditableMode.Focus;

            AGrid.AddTextColumn("Month", ASourceTable.ColumnDeadlineMonth, 80, FMonthEditor);
            AGrid.AddTextColumn("Day", ASourceTable.ColumnDeadlineDay, -1, FDayEditor);

            // Hook up editor events
            FDayEditor.Control.Validating += new System.ComponentModel.CancelEventHandler(Day_Validating);
            FMonthEditor.Control.Validating += new System.ComponentModel.CancelEventHandler(Month_Validating);
        }
        /// <summary>
        /// Sets the order of colums
        /// </summary>
        /// <returns>void</returns>
        private void CreateGridColumns()
        {
            SourceGrid.Cells.Editors.TextBoxUITypeEditor l_editorDt2;
            Ict.Common.TypeConverter.TDateConverter DateTypeConverter;
            FFamilyMembersDT = FMainDS.FamilyMembers;

            // Editor for Date of Birth column (Petra Date format)
            l_editorDt2 = new SourceGrid.Cells.Editors.TextBoxUITypeEditor(typeof(DateTime));
            l_editorDt2.EditableMode = EditableMode.None;
            DateTypeConverter = new Ict.Common.TypeConverter.TDateConverter();

            // DateTypeConverter.
            l_editorDt2.TypeConverter = DateTypeConverter;
            try
            {
                grdFamilyMembers.AddTextColumn("Person Name",
                    FFamilyMembersDT.Columns[PartnerEditTDSFamilyMembersTable.GetPartnerShortNameDBName()], -1, FSpecialCellController, null, null,
                    null);
                grdFamilyMembers.AddTextColumn("Gender",
                    FFamilyMembersDT.Columns[PartnerEditTDSFamilyMembersTable.GetGenderDBName()], -1, FSpecialCellController, null, null, null);
                grdFamilyMembers.AddTextColumn("Date of Birth",
                    FFamilyMembersDT.Columns[PartnerEditTDSFamilyMembersTable.GetDateOfBirthDBName()], -1, FSpecialCellController, l_editorDt2, null,
                    null);
                grdFamilyMembers.AddPartnerKeyColumn("Partner Key",
                    FFamilyMembersDT.Columns[PartnerEditTDSFamilyMembersTable.GetPartnerKeyDBName()]);
                FamilyIDDropDownValues = new Int32[] {
                    1, 2, 3, 4, 5, 6, 7, 8, 9, 0
                };
                FFamilyIDEditor = new SourceGrid.Cells.Editors.ComboBox(typeof(Int32), FamilyIDDropDownValues, false);
                grdFamilyMembers.AddTextColumn("Family ID",
                    FFamilyMembersDT.Columns[PartnerEditTDSFamilyMembersTable.GetFamilyIdDBName()], 80, FFamilyIDEditor);
                DisableEditing();
                FFamilyIDEditor.EnableEdit = false;
                FFamilyIDEditor.Control.Validating += new CancelEventHandler(this.FamilyID_Validating);
                // DevAge.ComponentModel.Validator.ValueMapping FamilyIDDropDownMapping =
                new DevAge.ComponentModel.Validator.ValueMapping();
            }
            catch (System.NullReferenceException)
            {
            }

            // to do if no lines.
        }