Solved

Create a Datagrid that allows you to add rows as needed

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

636 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