Hi
When I clone a ValueList the collection is empry?!
Thanks
Hi,
I tried this out with the following code and it's working fine for me.
private void button1_Click(object sender, EventArgs e) { ValueList valueList = new ValueList(); valueList.ValueListItems.Add(0, "Apple"); valueList.ValueListItems.Add(1, "Banana"); valueList.ValueListItems.Add(2, "Cherry"); ValueList clonedValueList = valueList.Clone(); foreach (ValueListItem item in clonedValueList.ValueListItems) { Debug.WriteLine(item.DisplayText, item.DataValue.ToString()); } }
Result:
0: Apple1: Banana2: Cherry
I had to make a loop and go creating valueList