プログラムによるListの作成例。프로그램을 사용한 SPList작성샘플

SPWeb myweb = SPControl.GetContextWeb(Context);
myweb.AllowUnsafeUpdates = true;
Guid listid = myweb.Lists.Add("SomeList", "", SPListTemplateType.GenericList); //静的な名前で登録。정적인 이름으로 일단 등록
myweb.Update(); //まずWebに登録処理を行わないと修正ができない。SPWeb을 업데이트안하면 수정이 안됨.
myweb.AllowUnsafeUpdates = true;
SPList targetlist = web.Lists[listid];
targetlist.Title = "実際の名前"; //画面に表示される名前を設定 화면에 표시될 이름을 설정
targetlist.OnQuickLaunch = true; //サイドリンクバーに表示
targetlist.Fields.Add("SomeFieldName", SPFieldType.Choice, false); //フィールドを1つ追加
SPFieldChoice fld_historytype = new SPFieldChoice(targetlist.Fields, CONSTActionHistory.ActionType);
fld_historytype.Title = "タイプ";
fld_historytype.Choices.Add("A");
fld_historytype.Choices.Add("B");
fld_historytype.Choices.Add("C");
fld_historytype.EditFormat = SPChoiceFormatType.Dropdown;
fld_historytype.Update();
targetlist.Update(); //SPListの更新
'SharePoint Services/WSS 3.0' 카테고리의 다른 글
| WSS SP2가 나왔네요.. (3) | 2009/05/11 |
|---|---|
| プログラムによるListの作成例。프로그램을 사용한 SPList작성샘플 (0) | 2008/07/26 |
| Aspxファイルでコードを実行するには. Aspx파일에서 프로그램코드 실행하기 (0) | 2008/07/01 |
| LookUpField의 쿼리문. LookUpFieldのクエリ文 (0) | 2008/05/30 |
| 페이지당검색결과수를 조절하기. 1ページあたりの検索結果数を変える [SharePoint] (0) | 2008/05/30 |
| [중요] WSS스케줄 리스트의 심각한 버그, WSSスケジュールリストの深刻なバグ [SharePoint] (1) | 2008/05/30 |
![]() |
![]() |
|
![]() |
![]() |
![]() |

Prev





Rss Feed