Exemple #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="opt">Used to get the LevelsCommand class's object.</param>
        public LevelsForm(LevelsCommand opt)
        {
            InitializeComponent();

            m_objectReference = opt;

            //Set control on UI
            LevelName = new DataGridViewTextBoxColumn();
            LevelName.HeaderText = "Name";
            LevelName.Width = 142;

            LevelElevation = new DataGridViewTextBoxColumn();
            LevelElevation.HeaderText = "Elevation";
            LevelElevation.Width = 142;

            levelsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { LevelName, LevelElevation });

            bindingSource1.DataSource = typeof(LevelsDataSource);
            //Must place below code on the code "dataGridView1.DataSource = bindingSource1"
            levelsDataGridView.AutoGenerateColumns = false;
            levelsDataGridView.DataSource = bindingSource1;
            LevelName.DataPropertyName = "Name";
            LevelElevation.DataPropertyName = "Elevation";

            //pass data to BindingSource

            bindingSource1.DataSource = m_objectReference.SystemLevelsData;

            //Record system levels's total
            m_systemLevelsTotal = m_objectReference.SystemLevelsData.Count;

            //Record changed items
            m_changedItemsFlag = new int[m_systemLevelsTotal];

            //Record deleted items
            m_deleteExistLevelIDValue = new int[m_systemLevelsTotal];
            m_deleteExistLevelTotal = 0;
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="opt">Used to get the LevelsCommand class's object.</param>
        public LevelsForm(LevelsCommand opt)
        {
            InitializeComponent();

            m_objectReference = opt;

            //Set control on UI
            LevelName            = new DataGridViewTextBoxColumn();
            LevelName.HeaderText = "Name";
            LevelName.Width      = 142;

            LevelElevation            = new DataGridViewTextBoxColumn();
            LevelElevation.HeaderText = "Elevation";
            LevelElevation.Width      = 142;

            levelsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { LevelName, LevelElevation });

            bindingSource1.DataSource = typeof(LevelsDataSource);
            //Must place below code on the code "dataGridView1.DataSource = bindingSource1"
            levelsDataGridView.AutoGenerateColumns = false;
            levelsDataGridView.DataSource          = bindingSource1;
            LevelName.DataPropertyName             = "Name";
            LevelElevation.DataPropertyName        = "Elevation";

            //pass data to BindingSource

            bindingSource1.DataSource = m_objectReference.SystemLevelsData;

            //Record system levels's total
            m_systemLevelsTotal = m_objectReference.SystemLevelsData.Count;

            //Record changed items
            m_changedItemsFlag = new int[m_systemLevelsTotal];

            //Record deleted items
            m_deleteExistLevelIDValue = new int[m_systemLevelsTotal];
            m_deleteExistLevelTotal   = 0;
        }