Exemplo n.º 1
0
        private void buttonRemoveAttRule_Click(object sender, EventArgs e)
        {
            var selRows = dataGridViewAttributionRules.SelectedRows;

            if (selRows.Count == 0)
            {
                return;
            }
            foreach (var r in selRows.Cast <DataGridViewRow>())
            {
                var dto = ((ObjectView <AttributionRuleDTO>)r.DataBoundItem).Object;
                _loadedAsset.RemoveAttributionRuleById(dto.Id);
            }
            attributionRules.DataSource = _loadedAsset.GetAttributionRules().ToList();
            EditorTools.HighlightItemInGrid <AttributionRuleDTO>(dataGridViewAttributionRules, Guid.Empty);
        }