protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyData == Keys.Enter && CurrentCell.ColumnIndex == Columns[performer.Name].Index) { List <Artist> artists = SelectMultipleArtistsDialog.GetResult( (List <Artist>) this[performersobj.Name, CurrentCell.RowIndex].Value); if (artists != null) { this[performersobj.Name, CurrentCell.RowIndex].Value = artists; } } base.OnKeyDown(e); }
public static List <Artist> GetResult(List <Artist> original_list) { SelectMultipleArtistsDialog d = new SelectMultipleArtistsDialog(); if (original_list != null && original_list.Count > 0) { d.multipleArtistSelector1.populateTable(original_list); } if (d.ShowDialog() == DialogResult.OK) { return(d.multipleArtistSelector1.GetResults()); } else { return(null); } }