I am using an XPTable (http://www.codeproject.com/Articles/11596/XPTable-NET-ListView-meets-Java-s-JTable) and try to add a comboBox column.
The comboBox column shows in the table but has no dropdown items to select.
Here is my code:
tblOrdModel.Rows.Clear();
var combo = new XPTable.Editors.ComboBoxCellEditor();
List<Supplier> sups = new DataRepository().GetSuppliers();
foreach (var s in sups)
{
combo.Items.Add(s);
}
combo.SelectedIndex = 0;
combo.DropDownStyle = XPTable.Editors.DropDownStyle.DropDownList;
colOrdModel.Columns[4].Editor = combo;
XPTable.Models.Row r = new Row();
r.Tag = tli.ItemRawMaterial;
r.Cells.Add(new Cell(tli.ItemRawMaterial.RM_StockCode));
r.Cells.Add(new Cell(tli.ItemRawMaterial.StockDescription));
r.Cells.Add(new Cell(tli.ItemQty));
r.Cells.Add(new Cell(tli.ItemDueDate.ToShortDateString()));
r.Cells.Add(new Cell(combo.Items[0]));
tblOrdModel.Rows.Add(r);
Why is this not working?
Ok, found the problem. I had the column not set to editable…set in designer or with:
Hope it helps someone else!