Beispiel #1
0
        public FormTable(ref DataParser data)
        {
            InitializeComponent();

            _Data = data.Table;

            _NameCol = new List<DataColumn>();
            _AreaCol = new List<DataColumn>();
            _CountCol = new List<DataColumn>();

            foreach (DataColumn c in _Data.Columns)
            {
                _NameCol.Add(c);
                _AreaCol.Add(c);
                _CountCol.Add(c);
            }

            this.dataGridView1.DataSource = _Data;
            for (int i = 0; i < dataGridView1.Columns.Count; ++i)
            {
                this.dataGridView1.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            }

            this.comboBoxName.DataSource = _NameCol;
            this.comboBoxName.DisplayMember = "ColumnName";
            this.comboBoxArea.DataSource = _AreaCol;
            this.comboBoxArea.DisplayMember = "ColumnName";
            this.comboBoxCount.DataSource = _CountCol;
            this.comboBoxCount.DisplayMember = "ColumnName";
        }
Beispiel #2
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FileSelect())
                {
                    throw new Exception("Failed to open file!");
                }
                else
                {
                    DataParser dataParser = new DataParser(_Filename);
                    FormTable  formTable  = new FormTable(ref dataParser);
                    formTable.ShowDialog();
                    UpdateFields();
                }
            }

            catch (Exception ex)
            {
                TaskDialog.Show("File Error", ex.Message);
            }

            labelPath.Text = _Filename;
        }
Beispiel #3
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FileSelect())
                {
                    throw new Exception("Failed to open file!");
                }
                else
                {
                    DataParser dataParser = new DataParser(_Filename);
                    FormTable formTable = new FormTable(ref dataParser);
                    formTable.ShowDialog();
                    UpdateFields();
                }
            }

            catch (Exception ex)
            {
                TaskDialog.Show("File Error", ex.Message);
            }

            labelPath.Text = _Filename;
        }