laputa.sky - Posted on 2008年8月4日 21:53:40

With branch for questions,an example will be perfect.
--------------------------------------------------------------------------------


AnswerSharePoint EnthusiastMVP - Posted on 2008年8月4日 22:21:05

You can programmatically add questions to sharepoint survey (list). Refer the following code

SPWeb web = SPControl.GetContextWeb(HttpContext.Current);

 Guid surveyId = web.Lists.Add("Name of the Title", "Description of the survey", SPListTemplateType.Survey);
                   
SPList survey = web.Lists["Survey List Name or Id];
 string Question = "Question#1 for survey";
StringCollection choices = new StringCollection();

choices.Add("first choice");
choices.Add("second choice");
choices.Add("third choice");

survey.Fields.Add(Question, SPFieldType.Choice, true, false, choices);

survey.Update();
web.Update();

I've not tried creating a branching question programmatically. Even that should be possible programmatically.

 

 

-------------------

分支可以通过修改Field的SchemaXMl来实现

后期给出代码

相关文章:

  • 2021-12-07
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2022-02-17
  • 2022-01-14
  • 2021-10-16
猜你喜欢
  • 2021-11-21
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2021-09-25
  • 2022-01-21
相关资源
相似解决方案