Results 1 to 2 of 2

Thread: Movement within a datagridview

  1. #1

    Thread Starter
    Hyperactive Member kuldevbhasin's Avatar
    Join Date
    Mar 2008
    Location
    Mumbai, India
    Posts
    488

    Movement within a datagridview

    hi
    i have a datagridview which contains data from the database
    say the datagridview has the following rows:
    Abc 123
    Abc 231
    Ccc 313
    cdc 321
    ddd ceq etc.

    now when the user presses c he should be taken to the 3rd row.
    when he cd he should be taken to the 4th row.

    i do not want to use the textbox as the datagridview contains more than 400 records and it has about 5 cols. which need to be filled up before saving and hence i cant re - populate the datagridview from the database.

    i hope i have make myself clear and could explain what the need is.

    thanks in advance.
    The only time you run out of chances is when you stop taking them.
    The mind is like a parachute.
    It doesn’t work unless it’s open.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,292

    Re: Movement within a datagridview

    You really should have the user type the search text into a TextBox. The number of records is irrelevant to that. You should query the database to populate a DataTable, bind that to a BindingSource and bind that to the grid. You can then handle the TextChanged event of the TextBox and do this:
    vb.net Code:
    1. myBindingSource.Position = myBindingSource.Find("Column Name Here", myTextBox.Text)

Tags for this Thread

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