Results 1 to 3 of 3

Thread: DataGridView: How to Select a Row

  1. #1

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394

    DataGridView: How to Select a Row

    I am used to using component one's Flexigrid, but I am currently evaluating the DataGridView in .Net 2005, to see if in fact this will now do everything the component one control could do.

    I have yet to find out how I can (in code) select a row/rows in the DataGridView. I have looked. Honestly...

    The equivelent in the C1.Flexgrid was grdList.Select(0,1)

    Thanks for your help.

    Si

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,430

    Re: DataGridView: How to Select a Row

    You're assuming that selecting a row in a grid is a function of the grid, but did it occur to you that it may be a function of the row?
    VB Code:
    1. myDataGridView.Rows(index).Selected = True

  3. #3

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394

    Re: DataGridView: How to Select a Row

    but did it occur to you that it may be a function of the row?
    Funnily enough that did occur to me, and in fact I did look at Rows and it's associated methods. What I didn't look at (more fool me) was using Rows with an Index. It is true to say that it is kind of obvious on reflection.

    As always - thanks for the help...

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