Adding Items in a datagrid

G

Guest

I have binded the two datagrids from database from two different tables. In
both datagrids, the first column contains checkbox. In between the datagrid,
i have "Add -->" and "Remove -->" buttons in between the datagrids. When i
select some items in the first datagrdi and click on "Add -->" button, the
selected items from the first datagrid should added to the second datagrid.
Similarly for the "Remove -->" button also. I should not connect to database
until i click on "Save" button. All the items that are added should be
inserted into the database when i click on "Save" button. Both datagrids are
Custom controls. How can we achieve this functionality.

Any help most welcome.

Regards
G.V.Srinivasa Rao.
 
S

Scott Allen

Hi Srinivasa:

Not being able to insert the data until clicking the save button is
always a little tricky. You'll have to carry the state of the data
around between user postbacks. One solution would be to keep both
tables of data in a DataSet and keep the DataSet in the Session - if
Session is available in your architecture.

Once the Save button event fires you can use DataAdapter.Update to
move new records into the database.

Making any sense?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top