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 do I create a button on the ribbon and how do I move the selected item(s) from the list/library into a Document Set?

share|improve this question
1  
Could you clarify your question, please? It seems like you're asking for a complete solution, rather than the answer to a specific query. –  Stuart Pegg Sep 22 '11 at 21:08
    
@StuartPegg I did some editing to save this question. I provided an answer as well :) –  Vedran Rasol Sep 22 '11 at 21:29
    
@VedranRasol: :) Fair enough. However, it seemed like they were asking how they could enable a ribbon button when a list item is selected (in the first part of their question). –  Stuart Pegg Sep 22 '11 at 21:36
    
@StuartPegg Thx, just to be on safe side I updated my answer to cover that option. I hope this question is now saved :) –  Vedran Rasol Sep 22 '11 at 21:45
add comment

1 Answer

Here you have something quite similar (just few changes needed):

How to Display a SharePoint Dialog from Ribbon Button and Get Selected Item Context

Basically you need two things:

  1. Custom ribbon/button similar to one described in article. With usage of dialog framework you open custom page and pass selected items values as querystring (all described in provided article)
  2. Custom Application page with one TextBox (DocumentSet name) and 2 buttons (OK, Cancel). OnLoad you read selected items from query string (article) and on button OK click you create your Document Set and move selected items into it (not in article!)

For that last part you can use info provided here: How to programmatically create document set, add or move files, GetDocumentSetById

For more info on Ribbon customizations I recommend reading SharePoint 2010 Ribbon Customization series by Chris O'Brien (@ChrisOBrienMVP).

Addition (thx goes to @StuartPegg):

Some info on how to enable Ribbon Button when item(s) in list is(are) selected:

Enable Ribbon button when one item only is selected and it is not folder

SharePoint 2010 Ribbon Customization Part VI: How to enable/disable buttons in ribbon conditionally?

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.