Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How would I be able to create a list field in VS that would be a lookup to select columns from any list?

I would preferably like to have something like the PickerTreeView.aspx, but instead of selecting lists select the lists' columns. Note that I don't want the column's value, I want the actual column.

Would this have to be done with a custom column and by editing my list's forms? (Edit/New)

I'm assuming something like this: http://blog.sandippatil.com/list-item-tree-view-in-sharepoint/ would be helpful to create the tree view.

Any help is much appreciated.

Thanks

share|improve this question
add comment

1 Answer

How I would approach this is the following:

  1. Create a custom field type http://msdn.microsoft.com/en-us/library/bb862248.aspx. This includes an xml definition and a class inheriting from SPField. Your field type would handling storing some sort of representation of the column as a string (Maybe ListName;ColumnName) and then resolving that representation to the actual list and column.

  2. Create a custom field control for you custom field type http://msdn.microsoft.com/en-us/library/bb861838.aspx. This is a class that inherits from BaseFieldControl, and handles actually transforming your field data into something the user interacts with

  3. Create a custom rendering template http://msdn.microsoft.com/en-us/library/bb862055.aspx. This is the markup that works with your field control to actually render something out.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.