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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datagrid drag n drop help..

Status
Not open for further replies.

yanikr

Programmer
Apr 29, 2004
8
CA
Hi, I need help with the following:

I have 2 datagrids, I drag a row from the source datagrid into the target datagrid. How can I remove the row from the source datagrid? The datasource of the datagrid is a dataset and I do NOT want to update the table from which it came from.. Please help.. I need to be able to do this asap..!!
 
If I understand you correctly you just want to update the view and not the actual data from the database is that correct.
 
Another suggestion, is that is there a reason why you cannot use a ListView? This would look "cleaner" while doing drag n' drop's, in my opinion. To me, DataGrids don't say "drag one of my rows."

Anyhow, if you choose to use a DataGrid, going by what bduke said, just don't call the update method of your DataAdapter, and you won't have to worry about the datasource being updated.
 
Thanks for your replies,

Yes I have 2 datagrids(DG1 & DG2) with datasets as sources. The user can drag a row from the source DG1 to DG2. The user has to manually enter other infos in DG2(The target grid) which is why I did not use a listview..

So how can I update/refesh my Datagrids, I just can't find how to do it.. Use a Datagrid row number and hide it? or delete the line from the dataset? But then how do I refesh my datagrid?

Thanks for your help!
Yanik
 
Just remove the row from your DataTable that you DG1 uses. Add a new Row to DG2 with the removed row's values.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top