.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 }
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
Post a Comment