本文介绍了SharePoint自定义列表“多行文本"列更改将富文本格式增强为“富文本格式"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在sharepoint自定义列表(风险)中有一个多行文本列,我想更改通过使用以下代码以编程方式增强富文本富文本,但此代码中并未发生这种情况.任何人都可以帮助我,我做错了什么地方.

I have a Multiple line text column in sharepoint custom list(Risks) and I want to changeEnhanced rich text to Rich text by programmatically using below code but didn't happen through this code. can anyone help me, where I am doing wrong.

                b ;                         = srcSite.OpenWeb())
              nbsp; bsp              {
              nbsp; bsp                 试试
              nbsp; bsp                 {              nbsp; bsp ;              nbsp; b ;              nbsp; b ;                                  
              nbsp; bsp               SPList列表= sWeb.Lists [风险"];
              nbsp; bsp               SPFieldMultiLineText描述=(SPFieldMultiLineText)list.Fields ["Description"];
              nbsp; bsp               Description.RichText = true;            &b               nbsp; bsp  
              nbsp; bsp               说明.Update();                b
              nbsp; bsp               list.Update();
              nbsp; bsp                 }
              nbsp; bsp                 catch(异常例外)
              nbsp; bsp                 {
              nbsp; bsp               字符串msg = ex.Message;
              nbsp; bsp                 }
              nbsp; bsp              }

                                        using (SPWeb sWeb = srcSite.OpenWeb())
                                        {
                                            try
                                            {                                                                                              
                                                SPList list = sWeb.Lists["Risks"];
                                                SPFieldMultiLineText Description =(SPFieldMultiLineText)list.Fields["Description"];
                                                Description.RichText = true;                                                
                                                Description.Update();                                              
                                                list.Update();
                                            }
                                            catch (Exception ex)
                                            {
                                                string msg = ex.Message;
                                            }
                                        }

Harjinder kumar SharePoint开发人员

Harjinder kumar SharePoint Developer

推荐答案

设置您的RichTextMode 如下所示.

Set your RichTextMode  as shown below.

SPFieldMultiLineText描述=(SPFieldMultiLineText)list.Fields ["Description"];
Description.RichText = true;            &b               nbsp; bsp  

SPFieldMultiLineText Description =(SPFieldMultiLineText)list.Fields["Description"];
Description.RichText = true;                                                

Description.RichTextMode = SPRichTextMode.FullHtml;                    nbsp; bsp       

Description.RichTextMode = SPRichTextMode.FullHtml;                                                

Description.Update();  

Description.Update();   


这篇关于SharePoint自定义列表“多行文本"列更改将富文本格式增强为“富文本格式"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 07:22