Results 1 to 11 of 11

Thread: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    64

    Cool DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    Can anyone help,
    I have 2 grids both populated and sorted. When i click a cell on the top grid, i want to be able to jump to a row on the bottom grid that may not be currently displayed without adjusting the sort order.

    This is a windows datagrid in VB.NET 2005. I know the row, and i have tried using rowselected collection, however it doesnt display the row. Again, i dont NOT want to reorder the grid, i simply want to show the row.

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

    Re: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    Is it a DataGrid or a DataGridView?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    Hi
    Code:
    Me.DataGrid1.CurrentRowIndex=pos
    Me.DataGrid1.Select(Me.DataGrid1.CurrentRowIndex)
    "The dark side clouds everything. Impossible to see the future is."

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    64

    Re: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    Thanks for the reply, i think i might be using DataGridView, not sure as its a wrapped row.
    Could please give me an example for both DataGrid DataGridView.

  5. #5
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394

    Re: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    Code:
    me.DataGridView1.FirstDisplayedScrollingRowIndex = intRow

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    How about we don't waste our time providing a solution for a problem you don't have? Just tell us which it is. Click on it and look at the type specified in the combo box at the top of the Properties window, or mouse over its name in code and read the tool tip. If you don't know then it's almost certainly a DataGridView as the DataGrid is not available in the Toolbox by default, so you'd have had to add it specifically.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    64

    Re: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    Thanksyou very much

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    64

    Re: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    Sorry had forgotten to mention it was a wrapped control
    so it was hard to see what the underlying windows control was.
    Had to find the source code for it etc.

    thanks

  9. #9
    Addicted Member
    Join Date
    Jan 2007
    Posts
    220

    Re: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    Hi jmcilhinney
    I want to know what is the meaning of wrapped control.
    and how do you use it.

  10. #10
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394

    Re: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    Quote Originally Posted by sd1978
    Hi jmcilhinney
    I want to know what is the meaning of wrapped control.
    and how do you use it.
    It isn't jmcilhinney who has the wrapped control it is ragstta, and to be honest no matter how "wrapped" it is, if you use intellisense on the control - it will tell you what type it is anyway.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    64

    Re: DataGrid wid 100s of rows, need to jump to ie scroll to specific row programaticaly

    Yes very true it does.
    My mistake apologies

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