c# - how to get fields list of view fields from SPSiteItemCollection -


i want fields list of spsiteitemcollection limited spquery view fields. example limited view field caml query this:

spquery.viewfields="<fieldref ='testfieldname' />"; 

and executed query code , splist.getitem(spquery) passed result function , want current view fields list in context expect "testfieldname" don't know how. know can find fields list codes this:

list<spfield> fields=listitem.fields.cast<spfield>().tolist(); 

or geting specific view code:

list<spfield> fields=list.views["viewname"].fields.cast<spfield>().tolist(); 

my question is: how can fields list of specific spquery view field?

have try use viewfieldsonly ? should return fields specified in query

spquery.viewfields="<fieldref ='testfieldname' />"; spquery.viewfieldsonly = true; 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -