Results 1 to 3 of 3

Thread: [RESOLVED] [2005] How the heck do I get the selected cell in datagridview

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2007
    Location
    Silly Clone Valley CA
    Posts
    47

    Resolved [RESOLVED] [2005] How the heck do I get the selected cell in datagridview

    I have it set to

    DataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect
    DataGridView1.MultiSelect = False

    so why can't I do this:

    Button_click blah blah blah handles a button click

    MsgBox(DataGridView1.SelectedCells.Item)

    end sub

    Thanks!

  2. #2

    Thread Starter
    Member
    Join Date
    Jul 2007
    Location
    Silly Clone Valley CA
    Posts
    47

    Re: [2005] How the heck do I get the selected cell in datagridview

    Ok, I guess it is something like this:

    MsgBox(DataGridView1.CurrentCell)

    Problem is, I want to return the data from the next column in that row, not the actual selected cell.

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2007
    Location
    Silly Clone Valley CA
    Posts
    47

    Re: [2005] How the heck do I get the selected cell in datagridview

    ok nevermind, I figured it out after a couple hours of fustration, it is:

    MsgBox(DataGridView1.CurrentRow.Cells(1).Value)

    Thanks for the great response Slumber! oh wait, that's me! Ahhhhhhh. Anyway maybe this can help someone else.

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