Esempio n. 1
0
        private void Public_Text_Group_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string name = this.Public_Text_Group.Columns[e.ColumnIndex].Name;

            if (e.RowIndex < 0)
            {
                return;
            }
            string text = this.Public_Text_Group.Rows[e.RowIndex].Cells[1].Value.ToString();

            if (name == "Rename_PublicText")
            {
                formReName formReName = new formReName();
                formReName.name_text_str = text;
                formReName.Set_Text_Name();
                formReName.ShowDialog();
                if (formReName.rename_result)
                {
                    LedPublicText ledPublicText = new LedPublicText();
                    ledPublicText = formMain.Ledsys.GetPublicText(text);
                    formMain.Ledsys.RenamePublicText(text, formReName.name_text_str);
                    this.ReName_load_List(text, formReName.name_text_str);
                    this.Public_Text_Group.Rows[e.RowIndex].Cells[1].Value = formReName.name_text_str;
                    this.publictext_noEdit.Remove(text);
                    this.publictext_noEdit.Add(formReName.name_text_str, ledPublicText.Text);
                }
            }
        }
Esempio n. 2
0
        private void dgvList_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            DataGridViewRow dataGridViewRow = this.dgvList.Rows[e.RowIndex];
            string          text            = dataGridViewRow.Cells[2].Value.ToString();

            this.dataSource = formMain.ledsys.GetDataSource(text);
            this.Binding(this.dataSource);
            dataGridViewRow.Cells[3].Value = this.dataSource.GetConnectionString();
            if (e.ColumnIndex == 4)
            {
                formReName formReName = new formReName();
                formReName.name_text_str = text;
                formReName.Set_Text_Name();
                formReName.ShowDialog();
                if (formReName.rename_result)
                {
                    string name_text_str = formReName.name_text_str;
                    if (text == name_text_str)
                    {
                        return;
                    }
                    formMain.Ledsys.RenameDataSource(text, name_text_str);
                    dataGridViewRow.Cells[2].Value = name_text_str;
                }
            }
        }