I have a Janus GridEX and I want to add a DropDownList with images and text to a column. When I populate the ValueList of the column I pass a DataView as parameter which contain a DataTable structured in this way:
var dt = new DataTable("asd");
dt.Columns.Add("value");
dt.Columns.Add("text");
dt.Columns.Add("img", typeof(byte[]));
then I add a row which contains one row:
var row2 = dt.NewRow();
row2["value"] = 1;
row2["text"] = "A2";
row["img"] = GetBytesFromImage(resources.Icon1);
this is the GetBytesFromImage routine:
private byte[] GetBytesFromImage(Icon ico)
{
using(var ms = new MemoryStream())
{
ico.Save(ms);
return ms.ToArray()
}
}
then I populate the valuelist:
grid.......PopulateValueList(dataview, "value","text","img",Color.Red, new Size(16,16)
then I get the error. Someone know why?