自定义字段的类型更新
我自定义了一个字段,他目前的基类是SPFieldText.
当我在修改字段属性时,我也要修改它的Type.但这里就报错了。。。
public void OnSaveChange(SPField field, bool bNewField) { GetUserProfileField lookup = (GetUserProfileField)field; lookup.IsNew = bNewField; lookup.MyCustomProperty = this.DdlLookupFieldTargetList.SelectedValue; lookup.ShowInDisplayForm = true; lookup.ShowInEditForm = false; lookup.ShowInNewForm = false; lookup.Type = ReturnFieldType("url"); //url 自动返回的是SPFieldType.URL; }