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
280
Valuelist copy issue
posted

Hi,

I want to copy the valuelist from one to another. I have used clone method it works fine. I found one property called CopyTo at ValuelistItems, I Want to use that but do not know how to do so.

Please help me how to copy each items of valuelist using valuelistitems using copyTo method.

I want to do

ultraGrid1.DisplayLayout.ValueLists["MyFirstVList2"].ValueListItems.CopyTo(MySecondVList2);

  • 469350
    Suggested Answer
    Offline posted

    Did you know that you can assign the same ValueList to more than one column?

  • 425
    Suggested Answer
    posted

    Hi,

    the target array must have enough space to receive the items. I hope it helps.

     

     

    ValueListItem[] items = new ValueListItem[MyFirstVList2.ValueListItems.Count];

    MyFirstVList2.ValueListItems.CopyTo(items, 0);

    MySecondVList2.ValueListItems.AddRange(items);

    Sven