Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need empty Datagrid(?)

Status
Not open for further replies.

hockeylvr

Technical User
Nov 26, 2002
140
I originally was trying to do this completely with Access but have decided to go with ASP.NET for the user interface.

I am trying to automate a form and create a word document from it. It is a form which users fill out to request part number files be sent to suppliers. There can be multiple part numbers and file types requested per form with no maximum.

i.e. Form structure
Part Number .dxf .ai .drw .pdf .igs
105115500 CHECKBOX UNDER EACH OF THE ABOVE OPTIONS
222550000 CHECKBOX UNDER EACH OF THE ABOVE OPTIONS

I am having trouble figuring out how to create a form with a blank "spreadsheet" like form that will have the above columns and initially about 15 rows with the ability to add more if needed.
I looked into the Repeater and DataGrid controls but all of the info I can find in books/internet only use these to view data from the database. I just want a blank area for the users to type the required info as many times as necessary and save the entries into the database on "Submit".

Does anyone have any ideas on how to accomplish this?

Thanks,

Toni
 
Thanks for the link - good article. I couldn't find any reference to just creating a blank datagrid though. All of the chapters a displaying data in the datagrid. I'm beginning to think it's just not possible and I can only edit data or show data and then add rows programatically.

Thanks again for the response, I will definitely refer to the article for other uses.

Toni
 
Have a look at the following article which shows you how to make an editable web grid (i.e. so you can add rows to it). I suggest to start with that you simply bind the datagrid to an empty datatable/set and let the user click add to start adding a new record.



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Thanks for the info. I think my problem is I cannot figure out how to bind the datagrid to an empty dataset. I have tried to use an invalid query which would produce no results and also just not filling the dataset, but they both just end up showing me column headings and no empty rows. Am I just not getting it??

Thanks,

Toni
 
That is correct, you will not show anything if there are no rows in the dataset. You need to add to the dataset (a blank row if you want) then rebind the grid. A grid with no rows in the dataset will ONLY show the headers.
 
Exactly, whcih is why I said:
ca8msm said:
I suggest to start with that you simply bind the datagrid to an empty datatable/set and let the user click add to start adding a new record.
e.g. they have an empty datagrid (column headers only as there is no data to be bound, then they click add and a new row appears.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
if you want 15 rows created for the user to edit, you would need to create 15 records then bind the grid to those records...maybe then hiding the key field so the records appear empty...but why would you want to create 15 records if you have no idead that all 15 records will even be used.

add a button the the grid to insert records as ca8msm said.

 
Thanks everyone. I get it now. I was trying to make it look and function just like the original Word Document we are currently using. It makes sense to me now to just add rows as needed.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top