This is a migrated thread and some comments may be shown as answers.

[Solved] Add items to empty grid?

1 Answer 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
scrut
Top achievements
Rank 1
scrut asked on 12 May 2008, 06:33 PM
Hi all,

I have a page with several controls. One of them should be a small table with 3 columns. The first column is a drop down box.
The thing is: this table will be initially empty. I want the user to be able to add items to this table by first selecting a value in column 1 (drop down box) and then enter some data into the text fields of columns 2 + 3.
I want the user to be able to create several such entries without postback (if possible).

I can't store this information in a database - only when the use clicks a big "Save" button will I be able to perform 2 insert actions:
1. save the data from the other controls
2. Iterate over the grid and save the data entered by the user. Thereby using the primary key of the tuple the first insert generated.

My questions are:
1. How do I set a radGrid up in a fashion that the user can add items even to an empty table?
2. How do I set it up that when the user comes back later, the grid displays the data he previously entered and allow him to edit it / add more items?
3. Where and how should I store the data since I can't really save the stuff in the DB before the user clicks the big save button?

Thanks a lot

s.

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 15 May 2008, 09:48 AM
Hello scrut,

I reviewed your questions and here are my suggestion:

  • To avoid the postback, you could use RadAjaxManager or RadAjaxPanel and turn it to an ajax request.
  • You can add new items to the grid despite its data source is empty.
  • Please find more about automatic insert/update/delete operations in this online demo.
  • You could use the Session to save the temporary data.

Let us know if you need further assistance.

Best regards,
Iana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
scrut
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or