Tuesday, September 13, 2011

SharePoint 2010 Tip #5: editing the NewForm.aspx in a list

If you need to edit the NewForm.aspx in a list and open it in SharePoint Designer, in advanced mode, you will notice that the webpart where the item adding happens is not configurable. It just displays a sample of what you'll get rendered in the page.

The reason for this is the default webpart used here is from the type ListFormWebPart, whose behavior is to automatically render the fields and controls needed according to the list definition. No customization here.

You'll need to add the DataFormWebPart, where these fields and controls will be fetched directly into your aspx page and can be edited. To do it, just go to "Insert > SharePoint > Custom List Form..." and choose your list, content type and the action you want to perform (new, edit, display). The old webpart can be deleted.

Warning: new fields will not be added automatically to this webpart.

No comments:

Post a Comment