Hot answers tagged lookup-column
2
Not possible really as such, particularly if you make it Required. But as alternative you should rather add a so called "0 option" and using an CEWP in the page you could use ECMA script to ensure validation using something like a jQuery library.
First we need jQuery JavaScript library and the jQuery Validation Plugin.
2.Upload the validation plug-in into ...
2
I would recommend using the declarative approach to provision your lookup, especially since it looks like your parent list is deployed this way. There is a trick to doing this, though, in that your lookup must be declared after the list instance representing your parent list. I handle this by provisioning my lookups directly inline with the list instance, ...
2
Use simple server object model to achieve this
you need to iterate each SPListitem and inside that call a function which will take item id as parameter and then query doc library to get desired items based on that
foreach(SPListitem item in list.items)
{
lst.add( GetAllDocs(item.ID));
}
public list<Documents> GetAllDocs(int id)
{
...
1
You must cast the field to a SPFieldLookup. This object has members like
LookupList,
LookupField and
LookupWebId
that will help you identify the correct list and field
See the MSDN documentation here
1
I suppose that you do not have your lookup items because when your list is created it does not know yet where to get columns from (source list does not exists).
What we usually do is moving XML declaration to event receiver when feature is activated. In this event receiver you should specify root web and list IDs to get it work. Here is the example:
var ...
1
I think you forget to specify some information on your code behind.
Take a look at this solution: http://salvatoredifaziosharepoint.blogspot.co.uk/2012/07/sharepoint-2010-create-content-type.html
BTW in the Field specification I wrote something like this:
<Field ID="{2AAD1044-89E9-4C88-8234-424A4B739C1C}" Name="LookupToList" DisplayName="LookupToList" ...
Only top voted, non community-wiki answers of a minimum length are eligible
