zoukankan      html  css  js  c++  java
  • 如何将sharepoint列表中choice类型的值绑定到dropdownlist上

      using (SPSite site=new SPSite(siteurl))
                {
                    using(SPWeb web=site.OpenWeb())
                    {
                        try
                        {
                            SPList list = web.Lists["ServiecesInfo"];
                            SPFieldChoice spcustomerlocation = new SPFieldChoice(list.Fields, "CustomerLocation");
                             for (int i = 0; i < spcustomerlocation.Choices.Count; i++)
                            {
                                ddlCustomLocation.Items.Add(new ListItem(spcustomerlocation.Choices[i].ToString(), i.ToString()));
                            }             
                        }
                        catch (Exception ex)
                        {
                            throw new Exception(ex.Message);
                        }
                    }
                }
  • 相关阅读:
    mysql关联查询
    文本框,下拉框,单选框只读状态属性
    sql索引实例
    sql视图实例
    SQL触发器实例
    存储过程实例
    sql 、linq、lambda 查询语句的区别
    LINQ中的一些查询语句格式
    面试宝典
    SQL常用语句
  • 原文地址:https://www.cnblogs.com/KingStar/p/1582727.html
Copyright © 2011-2022 走看看