VS 2010 Movement within a datagridview-VBForums
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
    456

    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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    96,542

    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)
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.