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

I developed in VS 2010 a custom list form and I want to use the "standard" Sharepoint Ribbon, ie, the same Ribbon used in all list forms withe the same buttons.

It's possible do this?

Any help will be appreciated.

share|improve this question

migrated from stackoverflow.com Mar 2 '12 at 13:28

This question came from our site for professional and enthusiast programmers.

2 Answers 2

I have an idea for this task - you can implement your custom form UI as a webpart and add it to a standard list item form. Then you need to hide (but not delete) a standart data form on that page. The idea behind it is to let the dataform webpart do the work for you - on a standard page it requests the needed tabs from the ribbon.. I've realized that it doesn't work because in this case you will not be able to control item save button - it will be rendered by DataFormwebPart. :(

share|improve this answer

Yes it is possible. In my case the was a visual studio solution that contained a list with custom forms.

    <Forms>
      <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\CustomDisplayForm.aspx" WebPartZoneID="Main" />
      <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\CustomEditForm.aspx" WebPartZoneID="Main"/>
      <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\CustomNewForm.aspx" WebPartZoneID="Main"/>
    </Forms>
  </MetaData>
</List>

And the pages referenced all are inherited from WebPartPage. The solution put these pages into {SharePointRoot}\Template\Pages.

Please let me know if you haven't got the idea and need more details.

share|improve this answer
    
It was one of my first trials. When I try to open a created item (my custom form is a display form), the form is open with no ribbon. –  cpinheiro Mar 2 '12 at 13:47
    
1) Ensure that your page inherits from a webpart page –  Maks Matsveyeu Mar 2 '12 at 20:44
    
2) Make sure that there is actually a listformwebpart on the page –  Maks Matsveyeu Mar 2 '12 at 20:44
    
3) hide the listforwebpart on prerender. This solution is quite dirty but when you realize how it all works you will be able to come to the idea how to make it more clear. Like my team and me did :) I wish you good luck –  Maks Matsveyeu Mar 2 '12 at 20:46
    
Thank you for your help. It works ;o) –  cpinheiro Mar 4 '12 at 19:32

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.