Re bonjour,


Après beaucoup de recherche sur le internet (notamment sur des forums américains) j'essay en vain de copier coller une ligne d'un Datagridview 2 dans un autre datagridview 1 par l'évènement du DoubleClick.

Les seuls bout d'exemples que j'ai trouvé mais que je n'ai pas réussi à appliqué sont sur cette page :

http://www.xtremevbtalk.com/showthread.php?t=188245

A priori cela serai possible par une fonction "Clone"

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
 
'This is where I Add the DataTable to the DataSet
objDataSet1.Tables.Add(objDataTable1)
 
'This is where I set the Datasource of the Datagrid to be populated
dgCarList1.DataSource = objDataSet1.Tables(0) 
 
'This is where I copy a row from one datagrid's datasource to the new datasource
objDataTable1.ImportRow(objDataTable.Rows(intSelectedRow))
"Nevermind I finally solved it. Here's what I did:

objDataTable1 = objDataTable.Clone

That got me the columns I needed for the new Table. After that, the importrow did it's thing and the new row showed up in the new datagrid!

Now I have a lot of formatting to take care of, but at least the data is there!

MKoslof, thanks for the time attention you gave to this thread, I appreciate that."


Je précise que mes 2 DGV sont bindés ducoup je me demande si cela est possible ou non ??

Avez-vous déjà réussi à faire cette manip ??