private void dgXiaoGuo_CellClick(object sender, DataGridViewCellEventArgs e) { txtXgName.Text = ""; txtXgName2.Text = ""; if (dgXiaoGuo.CurrentRow == null) { return; } _dgvDrc = dgXiaoGuo.CurrentRow; cboEffectType1.SelectedIndexChanged -= cboEffectType1_SelectedIndexChanged; DataHelper.SetCtrlByDataRow(groupBox1, _dgvDrc); cboEffectType1.SelectedIndexChanged += cboEffectType1_SelectedIndexChanged; btnAddXg.Visible = false; btnSaveXg.Visible = true; if (txtValue1.Text != Const.Zero && !string.IsNullOrEmpty(txtValue1.Text)) { txtXgName.Text = ExplainHelper.GetConditionName(txtValue1.Text); } if (txtValue2.Text != Const.Zero && !string.IsNullOrEmpty(txtValue2.Text)) { txtXgName2.Text = ExplainHelper.GetConditionName(txtValue2.Text); } lblMsg.Text = $"当前修改第{dgXiaoGuo.CurrentRow.Index + 1}行数据"; }
private void dgXiaoGuo_CellClick(object sender, DataGridViewCellEventArgs e) { CleatState(); _dgvDrc = dgXiaoGuo.CurrentRow; if (_dgvDrc == null) { return; } DataHelper.SetCtrlByDataRow(groupBox2, _dgvDrc); btnAddXg.Visible = false; btnSaveXg.Visible = true; if (txtValue1.Text.Length > 5) { txtXgName.Visible = true; btnSelBattleCondition.Visible = true; txtXgName.Text = ExplainHelper.GetConditionName(txtValue1.Text); } if (txtValue2.Text.Length > 5) { txtXgName2.Visible = true; btnSelBattleCondition2.Visible = true; txtXgName2.Text = ExplainHelper.GetConditionName(txtValue2.Text); } lblMsg.Text = $"当前修改第{_dgvDrc.Index + 1}行数据"; }
private void SetValue() { DataHelper.SetCtrlByDataRow(this, _dr); string[] condition = _dr.Cells["condition"].Value.ToString().Split(','); string buffName = condition.Where(t => t != "" && t != "0").Aggregate(string.Empty, (current, t) => current + (ExplainHelper.GetConditionName(t) + ",")); txtBuffName.Text = buffName.TrimEnd(','); }