Tuesday, February 22, 2011

add additional fields in sharepoint list 2010, using object model

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