コード例 #1
0
        private void ResultsetGrid_Load(object sender, EventArgs e)
        {
            this.isView = Connect.ViewsSelected;
            this.tableName = Connect.CurrentTable;
            this.btnNewVersion.ForeColor = SystemColors.ControlText;
            this.btnNewVersion.Text = "Check for updates";

            try
            {
                this.dataGridView1.AutoGenerateColumns = true;
                this.dataGridView1.DataError += new DataGridViewDataErrorEventHandler(dataGridView1_DataError);
                if (this.isView)
                {
                    this.toolStripButton1.Enabled = false;
                }
                else
                {
                    imageContext.Items.Add("Import Image", null, new EventHandler(ImportImage));
                    imageContext.Items.Add("Export Image", null, new EventHandler(ExportImage));
                    imageContext.Items.Add("Delete Image", null, new EventHandler(DeleteImage));                
                }
                LoadData();

                this.dataGridView1.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
                this.dataGridView1.AllowUserToOrderColumns = true;
                
                this.dataGridView1.KeyDown += new KeyEventHandler(dataGridView1_KeyDown);
                dgs = new DataGridViewSearch(this.dataGridView1);
                
            }
            catch (System.Data.SqlServerCe.SqlCeException sqlCe)
            {
                Connect.ShowErrors(sqlCe);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

        }
コード例 #2
0
        private void ResultsetGrid_Load(object sender, EventArgs e)
        {
            this.isView    = Connect.ViewsSelected;
            this.tableName = Connect.CurrentTable;
            this.btnNewVersion.ForeColor = SystemColors.ControlText;
            this.btnNewVersion.Text      = "Check for updates";

            try
            {
                this.dataGridView1.AutoGenerateColumns = true;
                this.dataGridView1.DataError          += new DataGridViewDataErrorEventHandler(dataGridView1_DataError);
                if (this.isView)
                {
                    this.toolStripButton1.Enabled = false;
                }
                else
                {
                    imageContext.Items.Add("Import Image", null, new EventHandler(ImportImage));
                    imageContext.Items.Add("Export Image", null, new EventHandler(ExportImage));
                    imageContext.Items.Add("Delete Image", null, new EventHandler(DeleteImage));
                }
                LoadData();

                this.dataGridView1.ClipboardCopyMode       = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
                this.dataGridView1.AllowUserToOrderColumns = true;

                this.dataGridView1.KeyDown += new KeyEventHandler(dataGridView1_KeyDown);
                dgs = new DataGridViewSearch(this.dataGridView1);
            }
            catch (System.Data.SqlServerCe.SqlCeException sqlCe)
            {
                Connect.ShowErrors(sqlCe);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }