Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I copy the text of a cell of a selected column of a row of  DataGridView into a listbox?
My Question is how can ,If we use a timer control and alternately select each row first and then copy the cell text of the selected column to the list box?
Means we want to Copy the text from the cells of the selected column of the  row of the datagridview one by one through Timer  to the listbox or textbox. I use the following code for getting one Current Row cell data from DataGridView. Please help


What I have tried:

myRegExp.Pattern = "(http|https|ftp|html)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~])*/*.html+"

           myMatches = myRegExp.Execute((DataGridView1.CurrentRow.Cells(1).Value.ToString))

           For Each myMatch In myMatches
               ListBox1.Items.Add(myMatch.Value)
           Next
Posted
Updated 10-Sep-22 1:51am
v2
Comments
Richard MacCutchan 10-Sep-22 9:26am    
You need to create a loop that iterates every row of the DataGridView.
noormian 10-Sep-22 22:46pm    
But How? I have tried but nothing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900