Пример #1
0
        public virtual bool HideCustomCtrl(out string val)
        {
            bool bRet = false;

            val = "";
            do
            {
                if (m_customCtrl == null)
                {
                    break;
                }
                Debug.WriteLine("hideDtp");
                m_customCtrl.hide();

                if (m_customCtrl == null)
                {
                    break;
                }
                if (m_customCtrl.isChanged())
                {
                    bRet = true;
                    val  = m_customCtrl.getValue();
                }

                this.Controls.Remove(m_customCtrl.getControl());
                m_customCtrl.Dispose();
                m_customCtrl = null;
            } while (false);
            return(bRet);
        }
Пример #2
0
        private void hideCustomCtrl()
        {
            if (m_customCtrl != null)
            {
                Debug.WriteLine("hideDtp");
                m_customCtrl.hide();

                if (m_customCtrl.isChanged())
                {
                    m_dataGridView.CurrentCell.Value = m_customCtrl.getValue();
                }

                m_dataGridView.Controls.Remove(m_customCtrl.getControl());
                m_customCtrl = null;
            }
        }
Пример #3
0
        public virtual void hideCustomCtrl()
        {
            if (m_customCtrl != null)
            {
                Debug.WriteLine("hideDtp");
                m_customCtrl.hide();

                if (m_customCtrl.isChanged())
                {
                    var val = m_customCtrl.getValue();
                    this.CurrentCell.Value = m_customCtrl.getValue();
                }

                this.Controls.Remove(m_customCtrl.getControl());
                m_customCtrl.Dispose();
                m_customCtrl = null;
            }
        }
Пример #4
0
        public virtual void showCustomCtrl(int col, int row)
        {
            Debug.WriteLine("showDtp");

            //fix error control not hide
            if (m_customCtrl != null)
            {
                Debug.Assert(false, "previous ctrl should be disposed");
                m_customCtrl.Dispose();
                m_customCtrl = null;
                return;
            }

            if (m_tblInfo.m_cols[col].m_type == lTableInfo.lColInfo.lColType.dateTime)
            {
                m_customCtrl = new myDateTimePicker(this);
            }
            else if (m_tblInfo.m_cols[col].m_lookupData != null)
            {
                m_customCtrl = new myComboBox(this, m_tblInfo.m_cols[col].m_lookupData);
            }
            if (m_customCtrl != null)
            {
                m_customCtrl.m_iRow = row;
                m_customCtrl.m_iCol = col;
                this.Controls.Add(m_customCtrl.getControl());
                if (CurrentCell.Value != null)
                {
                    m_customCtrl.setValue(this.CurrentCell.Value.ToString());
                }
                Rectangle rec = this.GetCellDisplayRectangle(col, row, true);
                m_customCtrl.show(rec);

                //ActiveControl = m_dtp;
                this.BeginEdit(true);
            }
        }
Пример #5
0
        private void showCustomCtrl(int col, int row)
        {
            Debug.WriteLine("showDtp");
            if (m_tblInfo.m_cols[col].m_type == lTableInfo.lColInfo.lColType.dateTime)
            {
                m_customCtrl = new myDateTimePicker(m_dataGridView);
            }
            else if (m_tblInfo.m_cols[col].m_lookupData != null)
            {
                m_customCtrl = new myComboBox(m_dataGridView, m_tblInfo.m_cols[col].m_lookupData.m_dataSource);
            }
            if (m_customCtrl != null)
            {
                m_customCtrl.m_iRow = row;
                m_customCtrl.m_iCol = col;
                m_dataGridView.Controls.Add(m_customCtrl.getControl());
                m_customCtrl.setValue(m_dataGridView.CurrentCell.Value.ToString());
                Rectangle rec = m_dataGridView.GetCellDisplayRectangle(col, row, true);
                m_customCtrl.show(rec);

                //ActiveControl = m_dtp;
                m_dataGridView.BeginEdit(true);
            }
        }