Using NetAdvantage 2006 v3 I am able to perform the following clone on a ValueList.
// Create a list for the Operations Center value.
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
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
Thanks Matt. I assumed that something like this was the case. I had already written my own clone method (after trying various other combinations of the different properties), but I was hoping there was something a little cleaner.
Thanks again. Kris