1
我想在我自己的字段類型中使用程序設定值。所以我重寫方法FieldRenderingControl(這是在點擊進入SharePoint列表中的元素時調用)。在BaseFieldControl或RichTextField中的設定值
我的代碼:
public override Microsoft.SharePoint.WebControls.BaseFieldControl FieldRenderingControl
{
get
{
BaseFieldControl fakeFieldControl = base.FieldRenderingControl;
RichTextField rtf = new RichTextField();
rtf.ID = "MultilineRichText";
rtf.ListId = fakeFieldControl.ListId;// list.ID;
rtf.ItemId = fakeFieldControl.ItemId;// item.ID;
rtf.FieldName = "MultilineRichText";
rtf.ControlMode = SPControlMode.Display;
rtf.Text = "test rich text";
rtf.Value = "test rich text value";
rtf.ItemFieldValue = "item field value";
rtf.ListItemFieldValue = "list item field value";
return rtf;
結果:控逆變模式始終顯示模式下,做工精細。但列值始終爲空。
任何幫助?我一點主意都沒有!