Select the content of a cell of the datagrid view

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amit1990
    New Member
    • Mar 2010
    • 3

    Select the content of a cell of the datagrid view

    I want to select the content of a cell of the data grid view, actually i got the code as follows

    Code:
    Dim a, b As Integer
            a = e.RowIndex
            b = e.ColumnIndex
    
           MsgBox(a & b)
            MsgBox( showsearch.SelectedRows(0).Cells(0).Value)
    but it works only when i click on the text of that cell and not on the area at the side of the text.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    You should check out what DataGrid Events are available to you and handle the one that you think is the most appropriate for your situation.

    In your case I think you would be most interested in handling the CellClick Event.

    -Frinny

    Comment

    • amit1990
      New Member
      • Mar 2010
      • 3

      #3
      yes it really works by changing the events to datagridview_ce llclick event


      thankz.........

      Comment

      Working...