http://msdn.microsoft.com/en-us/library/ff623048.aspx
here is the logic
string strFirstNameCol = relatedList.Fields.AddDependentLookup("First Name", primaryCol.Id);
SPFieldLookup firstNameCol = (SPFieldLookup)relatedList.Fields.GetFieldByInternalName(strFirstNameCol);
where, "primaryCol" is the main look up field in the second list.
No comments:
Post a Comment