Show the selected Row

ImDaFrEaK

Well-known member
Joined
Jan 7, 2006
Messages
416
Location
California
Programming Experience
5-10
I have an MP3 program. When the song changes, I can Select the Row with the Song Title ect. but you stil have to surf for it to use it. What's the deal. How do I show the selected Item rather than scroll to find it? Everytime the song changesI want the GridView to update to the location of the nowplaying song.
 
Howdy. I just created a small app with a DGV and some rows. Try this:

Me.DataGridView1.Rows.Item(Index).Selected = True
Me.DataGridView1.CurrentCell = Me.DataGridView1.Rows.Item(Index).Cells.Item(1)

This selects the entire row and then the first cell in it. When the first cell is set to the CurrentCell, the control automatically scrolls to its location.

Lemme know if this doesnt work
 
I have tried the selected row = True and it didn't work. It selected the row but you still had to scroll to find it. I will try current cell and see what happens right now.
 
Thanks man, I really appreciate it!

Thanks bro it worked. I have just used a DataGrid for my first time and this thing has methods and properties happening everwhere and I was just getting lost trying to figure it out. Thanks for taking some time and looking into it for me. Most pleased :)
 
Back
Top