コード例 #1
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            // перезагрузка таблицы
            DataTable newDataTable = new DataTable();

            if (LoadDataTable(baseAdapter, errLog, ref newDataTable))
            {
                dataTable = newDataTable;
                try { dataTable.DefaultView.RowFilter = txtFilter.Text; }
                catch { txtFilter.Text = ""; }
                bindingSource.DataSource = dataTable;
                ScadaUiUtils.AutoSizeColumns(dataGridView);
            }
        }
コード例 #2
0
        private void FrmBaseTableView_Load(object sender, EventArgs e)
        {
            // перевод формы
            Translator.TranslateForm(this, "Scada.Server.Ctrl.FrmBaseTableView");
            if (lblCount.Text.Contains("{0}"))
            {
                bindingNavigator.CountItemFormat = lblCount.Text;
            }

            // настройка элементов управления
            string tableTitle = BaseTableTitles.TryGetValue(baseAdapter.TableName, out tableTitle) ?
                                " - " + tableTitle : "";

            Text += " - " + baseAdapter.TableName + tableTitle;
            dataGridView.AutoGenerateColumns = true;
            bindingSource.DataSource         = dataTable;
            ScadaUiUtils.AutoSizeColumns(dataGridView);
        }