Results 1 to 4 of 4

Thread: [RESOLVED] Datagridview - can an entire row be selected?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2008
    Location
    United Kingdom
    Posts
    168

    Resolved [RESOLVED] Datagridview - can an entire row be selected?

    Is there a way to select an entire row in a datagridview?

    Select not just the single cell, but the whole row to highlight the whole row of a particular record?

    Eg -

    Customerid, name, address, location etc

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Datagridview - can an entire row be selected?

    You just set the DGV's SelectionMode property = FullRowSelect. You can do this either in design view or in code.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  3. #3
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Datagridview - can an entire row be selected?

    Code:
     dgv.Rows(intRowNo).Selected = True
    should do a trick
    __________________
    Rate the posts that helped you

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2008
    Location
    United Kingdom
    Posts
    168

    Re: Datagridview - can an entire row be selected?

    Cool fullrowselect is just what I wanted

    datagridview1.SelectionMode = DataGridViewSelectionMode.FullRowSelect


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