CJ

The circle of life – ** .Net – Training – MOSS **

  • Past Post

  • Vistor Locations

Master Detail View – Data View Web Part

Posted by Clayton James on May 21, 2008

I have some time to kill as I sit in a Melbourne apartment waiting on a phone call to hopefully receive Internet access. So I thought I would write a blog entry (you know….turn a negative into a positive :)). But I will have to wait for reconnection before I can post this entry 😉

I was asked a question recently about creating a master-detail form for employees and their work resume history. I immediately thought of InfoPath but a requirement was it needed to be in the browser. Unfortunately the infopath master detail control doesn’t render in the browser so after some thought…out came the lovely Data View Web Part (DVWP). So this is how the story goes…

1. Create a Resume Details list. Each row in this list must contain a column that links it back to the parent list. In my case Full Name.

2. Create a blank web part page

3. Open the site in SharePoint designer and open the blank web part page you just created and click in the top Header web part zone

clip_image002

4. Click the menu Insert –> SharePoint Controls –> Data View

5. You will notice on the top right hand pane the Data Source Library is displayed. Select the Employees list and drag it into the Data View Web Part.

clip_image004

6. Edit the columns of the web part to include what you want. I have a column called Full Name that I want displayed.

7. Now click in the Footer web part zone and Insert another Data View Web Part.

8. Drag the Resume Details list in the Data View Web Part and edit the columns as shown

clip_image006

9. The next thing for us to do is create a connection between the two web parts so when I select an Employee their resume details are displayed. Right click the Employees DVWP and select Web Part Connections.

10. You should see this dialog.
clip_image008

11. Click Next until you come the following dialog. Select the column that you want to make the connection between the two web parts.
clip_image010

12. Create a hyperlink on the connected field
clip_image012

13. Then click next and Finish the web part connection
clip_image014

14. Save the page in SPD and open the page in IE. You will now see the following screen. When you select an Employee the name is passed through to the Resume Details DVWP and filters the associated records

clip_image016

15. Now…what if you wanted to edit the details right here in the page…simple when using the DVWP. Go back to SPD and select the change layout option.

clip_image018

16. Select the following layout which is a Tabular Form Style. Don’t’ worry about the breaking of web part connections message. Everything should work fine.
clip_image020

17. Then select the Data View Properties and select the Editing tab and select all the check boxes and click OK.

clip_image022

18. Save the page and then view in the browser
clip_image024

19. Ok…so all is good. Now your optional exercise. Put in place some conditional formatting and maybe a Form Web Part passing in text values.

clip_image026

44 Responses to “Master Detail View – Data View Web Part”

  1. Darryl said

    Hi Clayton
    I need some urgent help.
    I want to be able to have a sharepoint list inside another list and be able to bring up a data record in the embedded list in its own window when you are editing a record in that embedded list.

    It will be as if you are going to the list on its own and wnating to edit the data of that record in the list. However this list will be inside another list.

    How can I do this?

    Please help. I want to do this without any coding if possible?

    I have attached an image of a EditForm.aspx that will be displayed when you go to edit a record from the embedded list inside the other list.

  2. sacchit said

    I have made connection but it does not change values depending on the first dataview selected value

  3. CJ said

    Darryl, I am not sure what you mean and I haven’t seen the attached image. If you would like to clarify further then you can email me on the About Me page.

    Sacchit, double check all your connections. Don’t forget that the item you select is the filtering parameter that is being passed to the second list. In this example it is Full Name which exists in both lists.

    Cheers

  4. Noyee said

    Good article……works perfet…Thankyou

  5. Kerrston said

    When I add Data View Web Parts some times the Create a hyperlink on the connected field is blank. I am not sure why this is and what causes it.

  6. vipul said

    i am facing problems when i do paging for a master detail web part using dataview in spd.
    the paging goes crazy for the details dataview after i set up web part connection with master dataview.
    i tried looking up for help but not successful. Can you help?

  7. Dave said

    Any ideas on how to pass the Key Field to the Insert command so that when you insert a new row on the Detail level it automatically attaches the parent ID, so that the new inserted detail record gets filed under the correct parent / master record?

  8. Trevo said

    I would like to know the same thing:

    >Any ideas on how to pass the Key Field to the Insert command so that when you insert a new row on the Detail level it automatically attaches the parent ID, so that the new inserted detail record gets filed under the correct parent / master record?

  9. Alex said

    I am trying to do the same thing as well. I want to open a Master item, view the detail in the web part and add a new detail item.

  10. Curt said

    Any word on whether you can have new details automatically linked to the master record?

  11. Wes Groleau said

    Step 14: First DVWP was there. Second was “Unable to display, try to fix with Sharepoint Designer”

  12. dishaniti said

    I like the article, but I am having little bit requirement. In master page I want allow user to enter employeeid, and thne depending on employeeid, I would like to display detail part.

    Is this possible and how?

  13. cj said

    To all that are having problems with passing the parent key in the child record.

    You need to include the Employee column (parent key) in the Resume Details DataView Web Part. The user will need to select the Parent key when inserting a new record.

    HTH

    • Tony Garrity said

      Sorry, can you expand on this a bit. I’m a newbie to all of this, I have a master/detail DVWP up and running. the only thing I cannot do is pre-populate the Insert new detail record with the parent key.

      TG

  14. […] https://claytonj.wordpress.com/2008/05/21/master-detail-view-data-view-web-part/ […]

  15. I suggest this post to my weblog visitors! you can see it in this address : http://pspcommunity.org/blogs/delpak/archive/2009/06/30/master-details.aspx

  16. brian brinley said

    great article, plain and to the point. Has solved a great need of mine without having to write a bunch of code.

    Thank you for taking the time to write this article the screen shots definately helped.

  17. mohsin said

    i am using 4 DVWP on my page.

    my requirements is that when the the user makes selection on first DVWP rest of the three show data accordingly so i used conenction and it is working fine.

    by default the fisrt item in my first DVWP is selected which is fine BUT i have another requirement that if i pass a variable using query string when calling that page, i want the second or the third item to be selected (depending on whose id i have passed).

    is it possible?

  18. Anshul Gagneja said

    Thanks a lot !!

    Works Perfect !!

  19. Raji Aoun said

    Hi Clayton,

    firstly i would to thank you for this great article, bur actually i have one issue when i tried it. the main issue is after i added the dataview in the editing tab the options of insert, update and delete are all disabled.

    i am using 2 lists Departments and Employees connected to each other by the Department ID.
    so can you help me.

  20. Cheat Point Blank terbaru…

    […]Master Detail View – Data View Web Part « CJ[…]…

  21. http://yourhealthandwellnesscoach.com said

    By Any Chance, do you have more blogposts similar to the following 1 called,
    Master Detail View – Data View Web Part | CJ? I actually really want to read through even
    alot more about it. Thanks for your time.

  22. You should also be able to count on polishing them to a high
    sheen due to the scratch resistance of the watch glass.
    A genuine luxury watch will be discussed intensively on the internet when you do a
    Google search. Imagine how it would feel to
    be dressed so snazzy for an event only to find out that your watch doesn’t match at all.

  23. Thanks for sharing your thoughts about graphic design. Regards

  24. Auto Title Loans: What They Are And How They Benefit Consumers, ‘ is the second online article now available. Refinancing your debt consolidation calculators is a strongly credible source for obtaining the wanted info. Another important document to show that states your financial capability and he will present the best option for immigrants is to turn to bad credit or no credit online through a credible loan service. Even though the interest paid on school loans. Be aware of following on the way to go.

  25. Do you feel integrating a slight darker tone of red on this website would make this post
    and website better? Just an idea 🙂

  26. I write a comment whenever I especially enjoy a article on a site or if I have something to contribute to the discussion.
    It is triggered by the fire communicated in the post I looked at.

    And after this article Master Detail View – Data View Web Part | CJ.

    I was moved enough to drop a comment 😛 I actually do
    have a couple of questions for you if it’s okay. Is it only me or does it look like a few of these remarks come across as if they are coming from brain dead visitors? 😛 And, if you are posting at other places, I’d like to keep up
    with you. Would you list every one of all your social sites like your Facebook page,
    twitter feed, or linkedin profile?

  27. Way cool! Some very valid points! I appreciate you
    penning this post plus the rest of the website is really
    good.

  28. bademode said

    Powinieneś być na pewno złuszczają. Nawet
    jeśli mieć bardzo delikatny lub sucha skóra,
    można użyć łagodny złuszczanie jak trzykrotnie
    regularne – dowolny znacznie mniej nie będzie odsłonić prawdziwa zalety,
    zdrowe skóra komórki, że leżał pod Twój prowadzi powlekanie z miejsca
    chusteczki. Wózki Twoja pory naskórka i skóry przez złuszczający to często oferty Twarz promienna,
    lśniące wygląd. Ponadto, Twój warstwa skóry prawdopodobnie będzie Rozwiązanie mniej i mniej, tłuste.
    bademode Stale usunięcia swój makijażu przed wyruszeniem spać.

    Po długie, stres wypełnione dzienne, może być atrakcyjne właśnie zjeżdżalnia bez
    konieczności podejmowania wysiłku usunąć makijaż.

    Nawet tak, zasypianiem wraz z makijaż na produkty może spowodować wiele problemy takie jak
    trądzik, zaskórniki i sucha skóra. przez podjęcie tylko kilka minuty przed łóżko meble wykupienia makijaż, można zachować skóra clear, zdrowy i
    nawilżona . bademode Kiedy jesteś nadal palenia, rzucić teraz!
    Palenie papierosów nigdy nie jest zdrowe dla Ciebie, jeszcze jest nawet więcej ważne, że jesteś
    rzucić gdy wiek. palenie papierosów rozbija kolagenu Twojej skóry tworzenia przedwczesne creases.
    palenie papierosów też natychmiast związane z wzrosła Zagrożenia problemy i
    odmiany raka, a ryzyka tylko rosnąć jak wiek. Daj się
    teraz, co twoim wieku, Aby pomóc Ciało używać zdrowy proces
    starzenia się. bademode Chcą żyją rozszerzony życia i jak proces starzenia?
    Aby dłuższych, pozostaje pozytywna. raporty wystawiał, że
    ludzie, którzy pewność samopoczucie także mają zazwyczaj
    dłużej i wiele zdrowsze życia. Spróbuj znaleźć na śmiech
    w codziennym życiu. Zabawa może Spadek, że nadciśnienie i pomocy wyczerpać stres właściwe ze swojego
    ciała. Sporo badania pokazują, przycisk korzystne Moc z Rozrywka i
    dokładnie, jak to sprawia czujesz o wiele lepiej.
    bademode dojazd na własną rękę polski paznokci może być bardzo
    irytujące, specjalnie kiedy dzięki czemu korzystanie z
    niski – superior ręce. następna okazja, zastosowanie color Kurtki oraz palto w ciągu dnia (dostarczyć polski kilka godzin do wyschły przed snem).
    Nie zainteresowanych zbytnio w przypadku polski staje na własną rękę skórek.
    Następnie codziennie, Popularność prysznicowe, a wszystko wszelkie
    dodatkowe połysk na własną rękę strefy będzie rub właściwe off.
    bademode Jeśli rozumieć sekret do ochrony przed starzenie,
    rozważenia na bieżąco i pieniędzy można zapisać na sztuczek, płyny
    i kremy. Niestety, nie może być tajne to zapobiega nam starzeje.
    Zamiast, starzenie dobrze dostaje się cel wiele osób.
    Wózki Twój ogólny stan zdrowia i spojrzenie najlepiej jest nieco trochę dużo łatwiej jeśli włączenia pewne sugestie, na przykład typy w tym artykule,
    , w twojej z dnia na dzień sposób życia. bademode To może
    być w żaden sposób za daleko rzucić palenia dla jako sposób powolne starzeje.
    palenie papierosów nie tylko podnosi potencjalne
    ryzyko rak płuc, jest związana wiele rak odmian raka,
    choroby sercowo-, oraz zmniejszyła odporność na choroba.
    Oczywiście, Ponadto obejmuje okropne wpływ na skóra.

    Przez rzucenie palenia, starzeje może być bardziej wygodne o wiele bardziej komfortowe a może i będziesz wydłużyć
    styl życia długość. bademode Pośród istotnych sposoby pozostałe młodszy
    będzie spełnione. Ciało reaguje do napięcie
    i lęk powoduje fizycznych problemy. Więc aby zatrzymać młodzieńczy ,
    gdzie można zdrowy ciało, styl życia powinien być
    załadowany rzeczy, adorować i usuń wszystkie inne Napięcia.
    Używać wykonywania i relaks posiadać młody i nauczyć się cieszyć
    świetne Punkty w codziennym życiu. bademode Toksyny są
    niebezpieczne po towarów ustanowiona w budowa ciała zmiany produkty żywnościowe i powietrza do elektryczność.

    Ponieważ chroni przed osoby Toksyny, przeciwutleniacze może pomóc jesteś poradzić sobie z wyniki z starzenie.

    Źródła przeciwutleniacze są wiele owoców, warzywa, i pełnoziarniste.
    Borówki, jeżyny, brokuły, szpinak|i są szczególnie głębsze
    artykuły spożywcze mają zazwyczaj większe objętość przeciwutleniacze.

    bademode Do wiek wdziękiem, upewnij się zaangażowania bezpieczeństwa do ciebie.

    Przez dodanie bezpieczeństwa początkowa, możesz uatrakcyjnienia
    prawdopodobieństwo zamieszkały już. Dodatkowo, będzie być zamieszkały przykładem aby twój młodzież i wnuki to
    bezpieczeństwa to ważne. Zawsze wykorzystanie swój pas bezpieczeństwa| podczas podróży samochodem.

    Załóż Ochrona głowy kiedy motocykl. Używać światła się Czujniki w swoim własnym domu,
    i zmienia jej akumulatory na bieżąco. Przez prostu pomocą wyrok dźwięku, że może
    zminimalizować niebezpieczeństwo wpadki, która może szkody całe ciało a nawet wyzwalacz przemija.

  29. Najbardziej wszyscy to Średnio przeciętny 1 witaminy
    lub inny, ale suplement że większość ludzie, zwłaszcza tych które starzenie Don ‘t dostać duży ilość
    jest Wartości odżywcze D. witaminy D pomoże Twoja wewnętrzna wellness poza swoje ładnie
    – jest, aby Era pięknie, zacząć od odbieranie mały słoneczne codziennie , co
    jest najlepsze metoda uzyskania Suplement D. Ponadto, jest to dopuszczalne do uzupełnienie zdrowia
    z produkty żywnościowe pełne Suplement D jak również witaminy.

    Ogólnie wyeliminowania swój produkty do makijażu przed wyruszeniem do łóżka.
    Zaraz po długie, stresujące dni, może być atrakcyjne do jedynie meble łóżko bez podejmowania wysiłku usunąć makijażu swoje.
    Jednak, zasypianiem wraz z kosmetyki na produkty może spowodować
    kilka problemy który obejmuje pryszcze, pryszcze i wyschnięte skóry.
    przez podjęcie tylko kilka minuty przed twoje łóżko usunąć
    , można zachować Twój warstwa skóry clear, zdrowy i uwodnione .

  30. I’m now not certain the place you’re getting your
    information, however good topic. I must spend a while finding out more or
    understanding more. Thank you for great information I was
    looking for this information for my mission.

  31. Gabriela said

    Hey I know this is off topic but I was wondering if you knew of any
    widgets I could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your
    new updates.

  32. http://mlodszywyglad.wordpress.com said

    I do agree with all the concepts you have offered for your post.
    They’re really convincing and can certainly work.
    Nonetheless, the posts are too brief for newbies.

    May you please prolong them a bit from next time? Thanks for the post.

  33. Deandre said

    You should take part in a contest for one of the finest blogs on the web.
    I most certainly will highly recommend this website!

  34. Louisa said

    This is really interesting, You are a very skilled blogger.
    I’ve joined your feed and look forward to seeking more of your magnificent
    post. Also, I’ve shared your web site in my social networks!

  35. Hello, its pleasant post regarding media print, we all understand media is a wonderful source of facts.

  36. Having read this I thought it was extremely informative.
    I appreciate you spending some time and effort to put this content
    together. I once again find myself spending a
    significant amount of time both reading and posting comments.
    But so what, it was still worthwhile!

  37. I am really pleased to read this blog posts
    which consists of lots of helpful information, thanks for providing such data.

  38. Aw, this was an extremely good post. Finding the time and actual effort
    to produce a superb article… but what can I say… I put things off a lot and don’t seem
    to get nearly anything done.

  39. psychoterapia

    Master Detail View – Data View Web Part « CJ

  40. Faustino said

    Measuring around 14.95 km, the elevated corridor may have nine channels.
    Initial section with this path is going to be Noida Sector 71 and it’ll
    expand around Greater Noida Knowledge Park V. Noida sectors 122, 123,
    Greater Noida Sector 4, Ecotech 12, and better Noida’s sectors 2, 3
    and 10 is likely to be section of this path.

  41. Techniques To help Enhance mortgage calculator On A Tight Spending Budget
    Brownsville-born Shimojikushi Peery interests includes mortgage amortization calculator extra
    payment, fine art, beach tanning. Finally the things
    he treasure among the most is watching an Carolina hurricanes hockey-game
    live.
    Virtually all mortgage rates comes to those who wait
    Successful strategies of bankrate mortgage calculator that can be used beginning this
    afternoon.
    How come all kinds of things you’ve heard of mortgage america is actually false
    and exactly what you need learn.

Leave a reply to Star Wars Force Collection Hack Cancel reply