?
Solved

Create a Datagrid that allows you to add rows as needed

Posted on 2006-06-21
5
Medium Priority
?
204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
mmarksbury earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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 video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

719 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