Solved

Create a Datagrid that allows you to add rows as needed

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

751 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