|
-
Jul 27th, 2008, 09:15 PM
#1
Thread Starter
Lively Member
[2005] How to automatically display a row (by scroll) in datagridview
In VB6, I got the following codes, how to do the same in VB 2005?
It set the rows(i) to be displayed in screen. but in VB.net, there is no TopRow.
vb.NET Code:
If (Grid.RowIsVisible(i) = False) Then
If (Grid.Rows - 7) < i Then
Grid.TopRow = (frm_korea.KRIDMapGrid.Rows - 7)
Else
Grid.TopRow = i
End If
End If
-
Jul 27th, 2008, 09:48 PM
#2
Re: [2005] How to automatically display a row (by scroll) in datagridview
It's not really that in VB.NET there's no TopRow. It's the fact that you're using a completely different control so, regardless of the language, the members of your old control are irrelevant.
What control ARE you using? A DataGridView I assume. Have you read the documentation for the DataGridView to see what members it DOES have? Wouldn't that be the place to start? If you do so you'll see the specific property that does the very same job as that TopRow.
You can wait for someone else to tell you what it is if you want, but if you use the doco and find it for yourself then you'll see how easy it is, then you'll be able to do the same in future. That's learning and that's how you get better.
-
Jul 28th, 2008, 12:34 AM
#3
Thread Starter
Lively Member
Re: [2005] How to automatically display a row (by scroll) in datagridview
Your opinion sounds good.
I handle this by setting current cell. It comes to my goal though not exactly the same function of TopRow.
However, there are some problems that the doc cannot help a lot, like my another thread
DataGridViewRow locating
-
Jul 28th, 2008, 12:43 AM
#4
Re: [2005] How to automatically display a row (by scroll) in datagridview
The actual property that is the same as TopRow is FirstDisplayedScrollingRowIndex, described in the documentation thusly:
Gets or sets the index of the row that is the first row displayed on the DataGridView.
You'll never never know if you never never look. That was an Australian advertising campaign so I don't expect you'll get the reference. Sounds cool to an Aussie though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|