I have a custom list for example "MyCustomListA" I have created a custom ListForm template and overide the ListFieldIterator. I have overide the ListFieldIterator and CreateChildControls to implement some readonly logica depandant of user membership.
One of the fields is a lookup to another custom list (MyCustomListB). In this custom list I am using a custom content type with 2 fields:
(MyCustomListB)
1: Title
2: Person or Group
The lookup shows a dropdownlist with for each item in "MyCustomListB" only the title. I would like to get the "Person or Group" value, someone know how??
public class CustomListFieldIterator : ListFieldIterator
{
protected override void CreateChildControls()
{
// some logic to set readonly depandant by user membership
}
protected override bool IsFieldExcluded(SPField field)
{
// some logic
if(field.InternalName.Equals("UsersAndGroups"))
{
// get users and groups from this field
SPUser selectedUsers = field.Some logic...
SPGroup selectedUserGroups = field.Some logic...
// some logic
}
}
}