Пример #1
0
        public virtual void LoadData()
        {
            //m_tblInfo = s_config.getTable(m_tblName);
            m_tblInfo.LoadData();

#if manual_crt_dgv_columns
            m_dataGridView.AutoGenerateColumns = false;
            lConfigMng.CrtColumns(m_dataGridView, m_tblInfo);
#endif
            m_dataContent = appConfig.s_contentProvider.CreateDataContent(m_tblInfo.m_tblName);
#if !use_bg_work
            m_dataContent.FillTableCompleted   += M_dataContent_FillTableCompleted;
            m_dataContent.UpdateTableCompleted += M_dataContent_FillTableCompleted;
#endif
#if !init_datatable_cols
            m_dataContent.Load();
#endif

            m_dataGridView.DataSource = m_dataContent.m_bindingSource;
            DataTable tbl = (DataTable)m_dataContent.m_bindingSource.DataSource;
            if (tbl != null)
            {
                update();
            }
            else
            {
                Debug.Assert(false, "tbl not created!");
            }

#if use_bg_work
            m_wkr            = myWorker.getWorker();
            m_wkr.BgProcess += M_wkr_BgProcess;
            m_wkr.FgProcess += M_wkr_FgProcess;
#endif
        }