如何查找查阅列的原始列名称。 [英] How to find original column name of a lookup column.

查看:182
本文介绍了如何查找查阅列的原始列名称。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表,它有一个查阅列。我如何以编程方式查找原始列名称。 EG我的查询列名是PDFListName,它是从公告列表中使用的列名ListName中取出的。请帮帮我。

I am having a list and it is having a lookup column. How can i programatically find the original column name. E.G my lookup column name is PDFListName and it is taked from column name ListName used in Announcements list.Please help me.

推荐答案

实际上,查找字段的类型是 SPFieldLookup ,此类型包含访问查询字段信息所需的全部信息,例如LookupList和LookupField等等。



只需获取该字段并将其转换为SPFieldLookup,您就可以访问其所有属性



Actually, The type of the lookup field is SPFieldLookup and this type contains all you need to access the lookup field info like the LookupList and LookupField and so on.

Just get the field and cast it as SPFieldLookup and you will be able to access all its properties

SPFieldLookup fldLookup = yourList.Fields.GetField("LookupFieldName") as SPFieldLookup;


这篇关于如何查找查阅列的原始列名称。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆