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

[Solved] Two Grids - DoubleClick Row To Insert

5 Answers 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Heath Brown
Top achievements
Rank 1
Heath Brown asked on 06 Oct 2009, 10:57 PM
Hello,

I'm a new customer who just purchased the controls today and am very excited.  I'm working on a little project and I need some help.

I have two radgrids on my page which are both populated by a different table in an SQLDataSource.  I want to be able to doubleclick on a row in table one to be able to insert the row just doubleclicked into the second grid's table (using a database insert).  I've already got drag and drop working (which functions the same way but allows them to drag the row from table 1 to table 2).  Is this possible and if so, can someone give me an example?

OR

Would it be easier if I had a clientselect column with checkboxes and a button in the commanditems (with a custom template) that is labeled "Add Selected Topics" and when pressed it would take any topics that are selected in grid 1 and insert them as new records into grid 2?  If I used this method I might completely remove drag and drop.  I had this version working as far as the grid and selecting items, but I couldn't figure out how to insert the selected items into the other grid's database table.  Bear with me though, I'll get better at this! :)

5 Answers, 1 is accepted

Sort by
0
Heath Brown
Top achievements
Rank 1
answered on 07 Oct 2009, 07:51 PM
Help!  Even if its just a link to an article that might help. :)
0
Thomas Salt
Top achievements
Rank 1
answered on 07 Oct 2009, 08:11 PM
This may help.

http://www.telerik.com/help/aspnet-ajax/grdgettingfamiliarwithclientapi.html
0
Heath Brown
Top achievements
Rank 1
answered on 07 Oct 2009, 08:52 PM
This does help quite a bit.  I'll see if I can figure out the rest.  Thanks for the clue!
0
Princy
Top achievements
Rank 2
answered on 08 Oct 2009, 07:35 AM
Hi Heath,

I found the following forum link which discussses on a similar case as yours wherein a solution mentioned was to disable the drag and drop feature in the grid, but instead have the control postback upon checking/unchecking the checkboxes, then insert the selected row details to the second grid's datasource and then bind the grid. Here's the link:
GRID ROW COPY FROM ONE GRID TO ANOTHER 

-Princy.
0
Heath Brown
Top achievements
Rank 1
answered on 09 Oct 2009, 02:22 PM
Thanks for the help everyone.  I'm still trying to figure out the best way to do this.  I might be using a RadListbox control instead.  I posted a question on the Listbox forum about 2 listboxes.  I have everything working the way I want now - except the insert.

P.S.  This Telerik community and Telerik itself is awesome.  I've been able to do some great work with these controls and I really appreciate both the community's help and the developers for making this great product.
Tags
Grid
Asked by
Heath Brown
Top achievements
Rank 1
Answers by
Heath Brown
Top achievements
Rank 1
Thomas Salt
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or