1,804 articles and 15,030 comments as of Monday, May 30th, 2011

EndUserSharePoint has combined resources with NothingButSharePoint.com. You can now find End User (Mark Miller), Developer (Jeremy Thake) and IT Pro SharePoint content all in one place!

This site is a historical archive and is no longer being updated. Please update your favorites, bookmarks and RSS feeds.

NothingButSharePoint.com
Wednesday, May 27, 2009

Data View Web Part, The Basics – Multiple Edit Forms

There are a couple of different things I’m going to show you in this article, and both of the entail editing data in the data view (data form) web part.

Multiple Edit Form

If you’d like users to be able to edit data in multiple records, without using the datasheet view, the multiple edit form is another option.  In the first article in this series, we showed how to insert a data view web part onto a web part page.  Here’s how to insert a multiple edit form instead:

In this example, I have a “Patient Admissions” custom list.  On the data source details tab, I select the fields to put in the view, and then click <Insert selected fields as> and choose <Multiple item form>

DVWP Editing

Save the page.
This is what the data view web part will look like in the browser:

DVWP Editing

Now, multiple items can be edited on one page, and the interface is a little prettier than the datasheet view (in my opinion).  Also, you can use this view to guide users to only edit certain fields here.  So, for example, if I don’t want the patient’s name to be edited here, but just the others, I can do that.  Note that this is not security, it’s just an interface.
Here’s how:

  1. In SPD, single click to select the “Patient Name” field.
  2. Click the little chevron (little arrow) next to this field

    DVWP Editing

  3. Change the “Format As” to Text.  Here’s what it will look like in the browser now:

    DVWP Editing

The Editing Tab

The second topic in this article regarding editing multiple items in the data view web part, is by configuring the Editing tab in the data view web part.  The goal here is to have a normal list of items as a display, and let users click to edit individual items directly on the screen.

  1. On a new web part page, look at the first screenshot above, and instead of inserting it as a multiple item form, choose Multiple item view this time.
  2. On the Common Data View Tasks, click Data View Properties, and go to the Editing tab.

    DVWP Editing

  3. This tab lets you choose the options that the users will be presented with in the interface.  You can allow options to edit items, delete items, and/or insert new items.  For this example, we’ll select all three.  Click OK.  This is the result:

    DVWP Editing

  4. You’ll notice that there’s a new column on the left side of the screen.  It contains edit and delete options (links) for each item in the list, and contains an “insert” link at the bottom of the list.  This is what an item looks like when “edit” is clicked:

    DVWP Editing

That one item (the second patient) is now editable, and there are now options to save or cancel the editing of that item.

Thanks for reading this information about multiple edit forms, and stay tuned for more articles in my data view web part series.

Laura RogersAuthor: Laura Rogers, Birmingham, AL

Laura Rogers is currently a SharePoint Administrator at HealthSouth Corporation in Birmingham, Alabama. She has ten years of experience with Microsoft’s messaging and collaboration systems. This includes four years in SharePoint implementation, training, and customization. Laura has been a MCSE since 1999, with her most recent certifications being MCSE 2003 + Messaging, MCTS in MOSS and MCTS in WSS 3.0 Configuration. She also wrote a chapter in the Microsoft Office SharePoint Server 2007 Administrator’s Companion by Bill English.

View all entries in this series: LauraRogers - Data View Web Part Basics»
 

Please Join the Discussion

25 Responses to “Data View Web Part, The Basics – Multiple Edit Forms”
  1. Kevin says:

    You taught me two things I didn’t know. Thanks for that! :-)

    Kevin

  2. Rick says:

    Laura-

    You continue to post information that is relevant, interesting and valuable… THANK YOU! I always look forward to your new posts as I know they will contain useful information, tips and insight into SharePoint!

    Rick

  3. Lynda says:

    Confirm that if you do not have Enterprise edition … this just makes you salivate but you can’t “do” anything.

  4. Laura Rogers says:

    Lynda,
    This is not just for Enterprise edition. This can be done on plain old WSS 3.0. SharePoint Designer is a free download now.

    Laura

  5. Marcus says:

    Does this require the use of Office 2007 pro to work ? as in the edit in datasheet view?

  6. Dhawal Mehta says:

    Very nice article.
    This is something what client were asking multiple times and we were denying it :(.

    Hope you don’t mind if I share it the same on my blog.

    thanks again for such a nice thing.

    Keep sharing.

    Thanks,
    Dhawal

  7. Marcus says:

    Laura,

    Really would like to use this however I dont have the option to insert Multi Item Form, has this changed since SP2? I now only have Insert:

    Multi Item View
    Single Item View

    Or Selecting the Row:

    Insert as a form List

    Marcus

  8. Nancy says:

    If a user does not have Contribute permissions to the source list, will these edit/delete/insert options still function for him/her?

    I gues what I mean is- how do these DVWP functions tie back to the permissions on the source list?

  9. Heidi Clark says:

    Laura, I have followed all of your articles here and your site too. Your instructions are very precise and easy to follow. I seriously think that you should write a book. You’re an excellent author!

  10. Robert says:

    Thanks for an interesting post Laura. I have a question as I have ran into some issues with multiple item forms. Is there anyway to control whether all items displayed are saved when posting back, or only those that have been changed?

    In my experience it seems that if the multiple item form consists of only text fields, all records will always be saved when posting back, regardless of whether they have been changed or not. However, if there is only a checkbox on the form, it seems that only those records that have been changed will be saved during postback.

    Have you run into this issue at any point?

  11. sireesh says:

    Hi

    I had a requirement where I used the sql database connection as data source for the data view webpart. On the page iam showing the webpart in multi item form with edit, delete and insert links. Now the thing is that i need to put validations when they the user tries to edit or inserting a record. Please let me know how to put those validation because if you click on edit it is not going to the editform.aspx page. I need the solution at the earliest to complete the assigned task.

    Thanks in Advance

  12. Laura,

    Would a DVWP or CQWP be the best option for combining 3 lists (having 3 columns that match) into one view. The catch is I need the to be able to select the items and have them open the item on its original list, not the new webpart.

  13. Joel says:

    Laura,
    I really appreciate this article – great stuff! I would love to be able to do this in my environment – however, I find that I don’t have the option on the dropdown to enter multiple item form (just single item view and multiple item view) and on the edit tab, all those options are greyed out and it says the options are unavailable because the current data source does not support them. My guess is this is either because it is a doc library or because it is data from a different site. Do you know anything about this or any work around?

    I have been able to insert an edit button (standard SP edit button image with my own link) that takes the user to the data on the other site to edit it and then returns them to this page, however I am also using filters on the page and all the users filters will then reset! :(

    thanks

  14. Kaoutar says:

    Hello
    Thank’s a lot for this article, it’s very interesting, But i have a problem, the menu doesn’t appear if we are using a linked data source

    Please Help me

  15. Kaoutar says:

    I haven’t seen Joel comment befor submitting mine,I think we have the same probleme, and it’s due to the fact that we are using data from different lists (Linked Data source)
    If some one have an issue to resolve this, please help!!!

  16. Ginger says:

    I love DVWPs! Thanks, Laura.

    I would appreciate any help you can offer on my current project.

    I’m trying to create a custom NewItem.aspx page which contains two web parts:
    - a DFormWP from list A, with the data inserted as New Item form, and
    - a second DFormWP from list B, with data inserted as a Single Item form.

    The goal is to enter a NewItem entry, and a drop down list field in the first web part would filter the second web part, which the user would update, all on the same page.

    Both lists have a column in common [Communication Name]. I’d like for the Communication Name form field in the New Item form (which is a drop down list) to somehow filter the second Single Item form DFWP.

    I first tried to connect the two web parts, but when I get to the last section in the wizard, no options are available for me to create a hyperlink on. So I ditched the web part connection idea.

    I can pass parameters for filtering with no problem if I add a separate ddl control to filter the list form wp, (Parameter source = control, ID=DropDownList1 ) but it seems pretty clunky. If users select a Communication Name once in the NewItem form, they don’t want to have to re-select it again in a separate control.

    I also thought I’d be able to use a form field as a parameter value, but haven’t been successful. Your thoughts?

  17. Rajan Garg says:

    Thanks Laura,

    nice post…..Do you have any idea how to perform client side validation on Save and Insert?

    I would be grateful to you…if you implement or give any idea.

    I tried to use asp validation controls but no luck!

    Looking forward for reply!!!!

  18. Rajan Garg says:

    One more thing Laura..i am using SPD 2010.

  19. Bruce says:

    I’m getting the following error when attempting to save changes after editing in the browser:

    Data Source Conflict: Your changes conflict with those made concurrently by another user. Refresh the form and submit your changes again.

    Any thoughts?

  20. John says:

    Hi Laura,

    Thanks for this useful post.

    I have created a multiple item edit form. And I haven’t enabled Insert & Delete.
    But If the Masterpage is attached, the web part inserts a blank item whenever page is posted back(on click of save / cancel in edit mode).
    Could you please help me in to solve this issue?

    Thanks and Regards,
    John Joseph
    India

  21. Cheryl says:

    Laura,
    Thanks for the great post. I am using the multiple item form on a ms-sql table and everything goes well all the data is displayed. When I go to edit, the first record on the page will update to sql but if I change any data on any other record it looks like it will work then changes the data back to what it was. I have the same problem if I do a multiple item view, then put the edit button on the individual lines. It just updates any information on the first record. Any ideas? Anyone else run into this problem?

  22. Cheryl says:

    Laura,
    Funny – I found the answer to my above question. If any of the text fields are blank in the database, the update fails going from null or blank to anything else. I am still working on a solution, but thought I’d share in case anyone else is running into the same issue.

  23. Rahul says:

    Hello Laura,

    I am trying to create a Data View Web Part on the top site and use multiple sources from the sub sites. I did this with ease on MOSS 2007 but unable to figure out on 2010.

    BTW.., I am using SharePoint 2010 beta version. Dont know if that makes any difference.

    Please help me.

    Regards,
    Rahul

Trackbacks

Check out what others are saying about this post...
  1. [...] has a new series on the Data View Web Part (DVWP).  All of her posts are great, but the Data View Web Part, The Basics – Multiple Edit Forms one showed me something I didn’t know that I could do with SharePoint Designer just by making [...]




Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!