private void dataGridViewTemplate_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex != 0)
            {
                string buttonText = this.dataGridViewTemplate.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
                if (buttonText == "预览")
                {
                    FormTemplatePreview fromTemplatePreview = new FormTemplatePreview(this.dataGridViewTemplate.CurrentRow.Cells[2].Value.ToString(), this.dataGridViewTemplate.CurrentRow.Cells[3].Value.ToString());
                    fromTemplatePreview.Show();
                }
                for (int i = 0; i < this.dataGridViewTemplate.Rows.Count; i++)
                {
                    this.dataGridViewTemplate.Rows[i].Cells[0].Value = false;
                }
                this.dataGridViewTemplate.Rows[e.RowIndex].Cells[0].Value = true;
            }
            else
            {
                for (int i = 0; i < this.dataGridViewTemplate.Rows.Count; i++)
                {
                    this.dataGridViewTemplate.Rows[i].Cells[0].Value = false;
                }
                this.dataGridViewTemplate.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = true;
            }
            
        }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-30
  • 2021-05-07
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2021-07-22
  • 2021-12-13
相关资源
相似解决方案