private void IsMulti_CheckedChanged(object sender, EventArgs e) { if (!IsMulti.Checked) { users.ForEach(t => t.IsChecked = false); int[] s = TviewFilter.GetSelectedRows(); if (s.Length > 0) { users[s[0]].IsChecked = true; } GridCtlFilter.RefreshDataSource(); } }
private void simpleButton2_Click(object sender, EventArgs e) { int[] s = TviewFilter.GetSelectedRows(); FilterItem newtask = s.Length > 0 ? devicetype[s[0]] : null; newtask.Name = Common.GetNewTaskName(); if (newtask != null) { FlyoutDialog dia = new FlyoutDialog(this.FindForm(), new AddDevice(newtask)); if (dia.ShowDialog() == DialogResult.OK) { this.FindForm().DialogResult = DialogResult.OK; } else { this.FindForm().DialogResult = DialogResult.Cancel; } } else { MessageBox.Show("请先选择一种类型"); } }