Beispiel #1
0
        private void создатьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TabPage temp = new TabPage($"New Table {Tables.TabPages.Count + 1}");

            Tables.TabPages.Add(temp);
            DataGridView dvg = new DataGridView()
            {
                Dock = DockStyle.Fill
            };

            temp.Controls.Add(dvg);
            JsonDataBase.LoadTemplate(ref dvg);
        }
Beispiel #2
0
        private void Open_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter      = "XLS files (*.xls, *.xlt)|*.xls;*.xlt|XLSX files (*.xlsx, *.xlsm, *.xltx, *.xltm)|*.xlsx;*.xlsm;*.xltx;*.xltm|ODS files (*.ods, *.ots)|*.ods;*.ots|CSV files (*.csv, *.tsv)|*.csv;*.tsv|HTML files (*.html, *.htm)|*.html;*.htm";
            openFileDialog1.FilterIndex = 2;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                TabPage temp = new TabPage(openFileDialog1.FileName);
                Tables.TabPages.Add(temp);
                DataGridView dvg = new DataGridView()
                {
                    Dock = DockStyle.Fill
                };
                temp.Controls.Add(dvg);
                JsonDataBase.LoadTemplate(ref dvg, openFileDialog1.FileName);
            }
        }
Beispiel #3
0
        public Dipper()
        {
            InitializeComponent();

            for (int i = 1; i <= 4; i++)
            {
                TabPage temp = new TabPage($"Курс {i}.xlsx");
                Tables.TabPages.Add(temp);
                DataGridView dvg = new DataGridView()
                {
                    Dock = DockStyle.Fill, AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
                };
                dvg.AllowDrop  = true;
                dvg.DragDrop  += new DragEventHandler(this.dataGridView1_DragDrop);
                dvg.DragEnter += new DragEventHandler(this.dataGridView1_DragEnter);
                temp.Controls.Add(dvg);
                JsonDataBase.LoadTemplate(ref dvg, $@"..\Template{i}.xlsx");
            }

            //JsonDataBase.LoadTemplate(ref dataGridView1);

            Pull.DataSource = JsonDataBase.PullOfSublect.ToList();
        }