By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,584 Members | 1,750 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,584 IT Pros & Developers. It's quick & easy.

Adding Items in a datagrid

P: n/a
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.
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sun, 20 Feb 2005 21:17:02 -0800, "Srinivasa Rao"
<Sr**********@discussions.microsoft.com> wrote:
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.


Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.