Solved

Web Form: How Do You Create a Web Form Containing a FormView and Two Sub Forms

Posted on 2011-09-30
4
165 Views
Last Modified: 2012-05-12
I have a web form in which I have a TABLE structure containing a FormView which displays a single row from a table. I have it coded such that I can switch between ItemTemplate (for viewing the data) and EditItemTemplate (for updating the data). This is working.

I also have on the same web page a separate TABLE structure into which I need to place something like a Repeater for displaying multiple rows of data. I chose the Repeater because I want to control the format of the data being displayed. Instead of displaying the row fields as columns, I want to display the fields one under the other with a separator between data rows. The Repeater seems to provide this capability, but, unlike the FormView, the Repeater only has the ItemTemplate. I need to be able to switch the view so that I can update the data.

How do you switch between View (readonly) and Edit within a Repeater? If it is possible, can you give a brief example or point me to a website that explains it?
0
Comment
Question by:Donna Kainer
  • 3
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 36903777
Are you looking for the capabilities of the DetailsView?
0
 

Accepted Solution

by:
Donna Kainer earned 0 total points
ID: 36919431
I found, in a Google search, a way to do most of what I need done (Edit and Delete) without the DetailsView. See http://sureshsharmaaspdotnet.wordpress.com/2008/05/12/edit-update-delete-in-repeater-in-aspnet/ for more information.

Using the above link I figured out how to get the Repeater to display the data from the database table with an Edit and Delete button on each row of data. However, there was no description of how to Add a record. I don't know how to get the Repeater to give me a blank row on request (I.E. I click an ADD button) so that I can type the data into the form and then add it to the database table.

Does anyone know how to do this?
0
 

Author Comment

by:Donna Kainer
ID: 36924765
My last comment should be a new question entry. I have created that entry. This can be closed.
0
 

Author Closing Comment

by:Donna Kainer
ID: 36947368
No one provided a better solution than the one I found via internet searches.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question