Solved

Create a Datagrid that allows you to add rows as needed

Posted on 2006-06-21
5
199 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

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 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