Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Problems with UltraComboEditor and ValueLists in UltraGrid
posted

Hi

I´m having some problems when I add a column with a UltraComboEditor to a ultragrid. The UltraComboEditor have a ValueList and when I load the grid all looks ok but when i try editing a row I get an error "Unable to update the data value. Unable to convert from system.string to system.Int32".

This is my setup:

var valueList = new ValueList();

var items = new ValueListItem[]
{
new ValueListItem(1, "one"),
new ValueListItem(2, "two"),
new ValueListItem(3, "three")
};

valueList.ValueListItems.AddRange(items);

var ultraComboEditor = new UltraComboEditor()
{
ValueList = valueList
};

ultraComboEditor.CheckedListSettings.CheckBoxStyle = CheckStyle.CheckBox;
ultraComboEditor.CheckedListSettings.EditorValueSource = EditorWithComboValueSource.CheckedItems;
ultraComboEditor.CheckedListSettings.ListSeparator = ", ";
ultraComboEditor.CheckedListSettings.ItemCheckArea = ItemCheckArea.Item;

var gridTable = new DataTable();
gridTable.Columns.Add("column", typeof(int[]));
gridTable.Rows.Add((new int[] { 1, 2 }));
gridTable.Rows.Add((new int[] { 1 }));
gridTable.Rows.Add((new int[] { }));

ultraGrid1.DataSource = gridTable;

ultraGrid1.DisplayLayout.Bands[0].Columns[0].EditorComponent = ultraComboEditor;
ultraGrid1.DisplayLayout.AutoFitStyle = AutoFitStyle.ExtendLastColumn;

/Andreas

MultiselectUltraGridColumn.zip
Parents Reply Children
No Data