Solved

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

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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