private void groupsGridView_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (groupsGridView.SelectedRows.Count == 1 && groupsGridView.SelectedRows[0].Index == e.RowIndex) { AreaMapComponent.SelectGroups(new List <AreaGroup> { AreaMapComponent.Groups[groupsGridView.SelectedRows[0].Index] }); } }
private void groupsGridView_SelectionChanged(object sender, EventArgs e) { List <AreaGroup> selectedGroups = new List <AreaGroup>(); foreach (DataGridViewRow rows in groupsGridView.SelectedRows) { selectedGroups.Add(AreaMapComponent.Groups[rows.Index]); } if (selectedGroups.Count > 0) { AreaMapComponent.SelectGroups(selectedGroups); } }