/// <summary> /// Обход грида вир. серверов по выделенным строкам. /// </summary> private void DataGridView3_SelectionChanged(object sender, EventArgs e) { try { if (dataGridView3.Rows.Count != 0) { if (dataGridView3.SelectedRows.Count > 0) { if (dataGridView3.Focused) { checkBox2.Checked = true; checkBox1.Checked = false; FilterGrid(dataGridView3); VirRowID = (byte)dataGridView3.CurrentRow.Index; VirServerID = (byte)dataGridView3[6, VirRowID].Value; } } } else { foreach (Control TB in Controls) { if (TB.GetType() == typeof(TextBox)) { TB.Text = string.Empty; } } } label1.Text = VirRowID.ToString(); label2.Text = VirServerID.ToString(); } catch { } }