Solved

Create a Datagrid that allows you to add rows as needed

Posted on 2006-06-21
5
196 Views
Last Modified: 2010-04-16
Hi Experts,
I am creating a web app that will allow a user to enter in data that could be multiple records.  The question I have is...What is the best way to accomplish this?  I would like to have one row that has the fields (all will be dropdown list) they need to enter and then maybe a couple of buttons that would allow them to either submit this data or add another record (prior to submitting..only transmit the data once).  I was thinking about just using the datagrid, but I have not had much luck creating dropdown list in a datagrid and am not sure how to add a new record if needed.

Can you all assist with creating a dd list in a datagrid and how I could add a new row/record?

Hope this makes sense and look forward to your expert advice.

Thanks,
Paul
0
Comment
Question by:pwtucker
  • 3
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
mmarksbury earned 500 total points
ID: 16955731
USe this approach:

1. Create a DataSet to use as your DataSource.  You will bind this to the DataGrid.

2. Create a form that allows entery of values using your drop downs.

3. Create a datagrid and bind the DataSet to it.

4. When the user enters another value, update the DataSet and re-bind.

That should do it for you and you don't have to worry about the drop down in the data grid.
0
 
LVL 1

Author Comment

by:pwtucker
ID: 16959185
I like the idea, but this will cause several trips back to the server correct????  Or was the dataset local???
0
 
LVL 7

Expert Comment

by:mmarksbury
ID: 16960433
It will make several trips back to the server indeed.  If you want to avoid that, you can build this up using Javascript, and have a final submit button, but that's likely to be quite a substantial amount of code compared to this solution.  Ajax is always a possibility as well, but still adds some overhead to the server.
0
 
LVL 1

Author Comment

by:pwtucker
ID: 16960459
Thanks for the help....I am going to give this a shot and will let you know how it works in the next day or so....
0
 
LVL 7

Expert Comment

by:mmarksbury
ID: 16960485
Good luck!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

20 Experts available now in Live!

Get 1:1 Help Now