[2005] Extracting SELECTED Cell Text from Datagridview
Hey everyone, so I have a big datagridview with several columns representing movies.
Right now columns are : Title, Genre, Rating, Plot, Path
Path is the path on the computer to the AVI file (ie C:/Movies/Matrix.avi)
So I also have a windows media player control on my form
What I want, is when a user selects a row (or any cell in that row), and then presses a button, the button changes the Windows Media Player "URL" property to the Path field of the selected row (every entry has a path field).
So even if only the title cell of a movie is selected, or a genre cell - it should extract the Path of whatever row that is in and set the WMP URL to that path.
Any ideas?
Thank you!
Re: [2005] Extracting SELECTED Cell Text from Datagridview
Suppose that "Path" is the name of column that show the file path, you can read the value of that particular cell in the current row like this
Code:
Dim filePath As String = DataGridView1.CurrentRow.Cells("Path").Value.ToString()
Re: [2005] Extracting SELECTED Cell Text from Datagridview
Works perfectly! Thank you! :)