using NaiBa.Util.Extension; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace TemuKJD.KJDForms.SalesCenterForms { public partial class GroupBuyMonitorForm : Form { public GroupBuyMonitorForm() { InitializeComponent(); } private void btnSetActivity_Click(object sender, EventArgs e) { } private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) return; var colName = dgvShop.Columns[e.ColumnIndex].Name; if (colName == "colSelect") { // 只允许单选 if (dgvShop.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ParseToBool() == true) { dgvShop.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = false; } else { foreach (DataGridViewRow row in dgvShop.Rows) { row.Cells[e.ColumnIndex].Value = false; } dgvShop.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = true; } } } } }