posts - 5,  comments - 5,  trackbacks - 0

ViewFields是SPViewFieldCollection, 只能拿到interal name,要获取中文的字段名,可以事先做一个internalName到title的转换:

using System.collection;

SPSite site = new SPSite("url");

SPWeb web = site.OpenWeb();

SPList list = web.Lists[listname];

SPView listview = onelist.Views[view];

Hashtable internalToTitle = new Hashtable();

foreach(SPField field in list.Fields)
{
internalToTitle.Add(field.InternalName, field.Title);
}

输出的时候转换一下:
for(int j=0;j<listview.ViewFields)
{
output.write(internalToTitle[view.ViewFields[j]].ToString());
}

posted on 2006-10-30 10:32 曾科 阅读(336) 评论(1)  编辑  收藏 所属分类: SharePoint Portal Server

FeedBack:
# re: 如何获取WSS列表视图的中文字段
2008-01-23 18:17 | foxhorse
谢谢!  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航:
 
<2008年1月>
303112345
6789101112
13141516171819
20212223242526
272829303112
3456789

常用链接

留言簿(3)

随笔档案

文章分类

文章档案

相册

.net

搜索

  •  

最新评论

阅读排行榜

评论排行榜