Hi. I am evaluating your products.
I am trying to use a Combox as Editor in the grid. I don’t understand why I can’t use a bindingList as datasource…
Here is the code of the Form. Any cues would be great. Thanks. See code below.
private BindingList<PartyType> _listPartyType;
private BindingList<Personne> _listPersonne;
public Form1()
{
InitializeComponent();
_listPartyType = new BindingList<PartyType>();
_listPartyType.Add(PartyType.PersonnePartyType());
_listPartyType.Add(PartyType.CompagniePartyType());
}
private void winButton1_Click(object sender, EventArgs e)
{
_listPersonne = new BindingList<Personne>();
_listPersonne.Add(Personne.Personne1());
_listPersonne.Add(Personne.Personne2());
_listPersonne.Add(Personne.Personne3());
grid.DataSource = _listPersonne;
ComboBoxEditor multiColumnComboBoxEditor = new ComboBoxEditor(_listPartyType, “DisplayValue”, “ID”, “%DisplayValue%”);
multiColumnComboBoxEditor.TemplateControl.DropDownSize = new Size(250, 150);
grid.Columns[“PersonnePartyType”].CellEditorManager = multiColumnComboBoxEditor;
grid.Columns[“PersonnePartyType”].CellViewerManager = new ComboBoxViewer(_listPartyType, “DisplayValue”, “ID”, “%DisplayValue%”);
//grid.Columns[“PersonnePartyType”].CellEditor.SetWinComboBoxStyle(multiColumnComboBoxEditor.TemplateControl);
//dataRow.Cells[“Editors”].Value = 4;
}
Imported from legacy forums. Posted by Mathieu (had 891 views)