Results 1 to 2 of 2

Thread: [2005] How to tell what row is selected on DataGridView

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2005
    Location
    Wisconsin
    Posts
    788

    [2005] How to tell what row is selected on DataGridView

    How can I tell what row was clicked on the DataGridView?

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142

    Re: [2005] How to tell what row is selected on DataGridView

    you can use the SelectedRows property, eg:
    Code:
        Private Sub DataGridView1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.SelectionChanged
            If DataGridView1.SelectedRows.Count > 0 Then
                Console.WriteLine(DataGridView1.SelectedRows(0).Index)
            End If
        End Sub
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width