I have a custom webpart that was defined with a property like
[Personalizable(PersonalizationScope.Shared), WebBrowsable(true), WebDisplayName("Chart Type"), Category("Chart - Required")]
[InitializationParameterName("ySeriesType")]
public DataSeries1 YSeriesType { get; set; }
which has been deployed. I then changed it to:
[Personalizable(PersonalizationScope.Shared), WebBrowsable(true), WebDisplayName("Chart Type"), Category("Chart - Required")]
[InitializationParameterName("ySeriesType")]
public YSeriesType YSeriesType { get; set; }
This change now causes an error suggesting DataSeries1 was not found.
How can I handle the upgrade for this scenario?
Fwiw, the following IVersioningPersonalizable
did not seem to work:
void IVersioningPersonalizable.Load(IDictionary unknownProperties)
{
if (unknownProperties == null)
return;
_dirty = true;
foreach (DictionaryEntry entry in unknownProperties)
{
switch (Convert.ToString(entry.Key))
{
case "YSeriesType":
this.YSeriesType = (YSeriesType)Enum.Parse(typeof(YSeriesType), Convert.ToString(entry.Value));
break;
}
}
}
protected override void OnInit(EventArgs e)
{
if (_dirty && null != base.WebPartManager)
{
SetPersonalizationDirty();
_dirty = false;
}
}
Thanks!