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
455
Clone A ValueList
posted

Using NetAdvantage 2006 v3 I am able to perform the following clone on a ValueList.

// Create a list for the Operations Center value.

ValueList valueList = igrdSubstations.DisplayLayout.ValueLists["OperationsCenter"];

foreach (DataRow row in dsDevices.Tables["OperationsCenters"].Rows)

{ valueList.ValueListItems.Add(Convert.ToInt32(row["OpCenterID"]), row["OpCenterName"].ToString()); }

// This is also used in the divisions column.

igrdBuses.DisplayLayout.Bands[0].Columns["division"].ValueList = valueList.Clone();

For reason beyond my control I have to revert back to NetAdvantage 2006 v2

I can't do the Clone() operation now.

Can someone tell me how to do this in version 2.

Thanks, Kris

Parents
No Data
Reply
  • 37774
    Verified Answer
    posted

     Kris,

    It looks like the Clone method was added to 6.3 as part of a bug fix, which uses an internal method called InitializeFrom.  Unfortunately there is nothing that we can do about this, as 6.2 is no longer a supported version, so you have 2 options:

    1)  Copy all the properties and ValueListItems yourself (basically write your own Clone method)

    2) If your application will have reflection permissions, you could try to access the InitializeFrom method, which you can use to initialize your new ValueList (which is how the Clone method is implemented in 6.3).

    -Matt

Children