Hi, i've read about copying cell contents from DataGridView to Textbox in VB.NET Help, but i think it's incomplete.
What i need to do is for the DataGridView's SelectionMode to be FullRowSelect, but i only want to assign a certain column's value to my search string, so i can specifically set my SQL statement to populate a series of textboxes that contains data returned from said SQL statement.
Preceding lines of code gets the value of the entire selected row, but i only need the leftmost value, before the space that separates the 1st column from the 2nd.
I have tried looking for the 1st occurrence of " " with InStr() function, but it seems that the " " between the returned columns is not whitespace (" ") but something else. I think it's a TAB, but i dont know how to test for TAB or other special characters using InStr() function.
I hope somebody can help me with this. Thanks in advance.
What i need to do is for the DataGridView's SelectionMode to be FullRowSelect, but i only want to assign a certain column's value to my search string, so i can specifically set my SQL statement to populate a series of textboxes that contains data returned from said SQL statement.
VB.NET:
Clipboard.SetDataObject(DataGridView.GetClipboardContent())
Dim SelRow As String = Clipboard.GetText()
I have tried looking for the 1st occurrence of " " with InStr() function, but it seems that the " " between the returned columns is not whitespace (" ") but something else. I think it's a TAB, but i dont know how to test for TAB or other special characters using InStr() function.
I hope somebody can help me with this. Thanks in advance.
Last edited by a moderator: