Solved

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

Posted on 2011-09-30
4
162 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What .NET website keeps me current? 9 54
Allow space in this pattern 2 46
IIS Express Working in one Visual Studio Solution, but not in another. Why? 2 14
Run time Error 4 34
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now