【问题标题】:I need to get the values of Sharepoint Field Choice Column in Sharepoint 2007 without accessing a list我需要在不访问列表的情况下获取 Sharepoint 2007 中的 Sharepoint 字段选择列的值
【发布时间】:2010-05-06 16:22:34
【问题描述】:

我想这样做,但不访问列表“项目”,也就是说,可能使用根站点或内容类型访问列,而不取决于可以在 Sharepoint 应用程序内创建或不创建的列表.

SPFieldChoice choice = (SPFieldChoice)items.Fields[namefield];

                foreach (string choiceName in choice.Choices)
                {
                  //etc...
                }

【问题讨论】:

    标签: sharepoint sharepoint-2007 moss


    【解决方案1】:

    你可以使用web.FieldsContentTypes[typeName].Fields

    SPWeb web = ... ;
    
    SPFieldChoice choice = (SPFieldChoice)web.Fields[namefield];
    

    SPFieldChoice choice = (SPFieldChoice)web.ContentTypes[typeName].Fields[namefield];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-31
      • 1970-01-01
      • 2010-12-17
      • 2011-05-03
      • 2023-03-24
      • 1970-01-01
      • 2014-07-03
      • 1970-01-01
      相关资源
      最近更新 更多