c# - Retrieve document template type from SPList -
when working in sharepoint creating custom splist using following method:
from msdn:
public virtual guid add( string title, string description, string url, string featureid, int templatetype, string doctemplatetype, splisttemplate.quicklaunchoptions quicklaunchoptions )
the doctemplatetype passed declare document template type. possible retrieve document template type existing splist? can useful i.e. when copying list.
thanks in advance.
use splist.basetemplate property list definition type on list based, example:
splist list = web.lists.trygetlist(<list title>); splisttemplatetype templatetype = list.basetemplate; int templatetypeid = (int) templatetype;
how document template associated list
splist list = web.lists.trygetlist(<list title>); var doctemplate = web.listtemplates.oftype<splisttemplate>() .firstordefault(lt => lt.type == list.basetemplate); console.writeline(doctemplate.documenttemplate);
Comments
Post a Comment