.net - Sharepoint 2010 SPListTemplate how to get list of fields? -


i need fields list template? how can this?

var web = site.openweb(); var template = web.listtemplates["sometemplate"]; template ... ???? -there no method fields. 

there no built-in method fields list template. way can fields parsing schema xml of list , getting <field> , <fieldref> tags.

easier create list instance, can query later on following examples.

to fields list can use splist.fields property, e.g. so:

foreach (spfield spfield in mylist.fields) {     //your code here } 

msdn splistitem.fields

you can fields list item "in reverse" splistitem.fields property. might interested in thread: check if list column exists using sharepoint client object model?


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -