Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use this code?

Status
Not open for further replies.

luisve

Programmer
Jun 24, 2005
29
US
hi i found this code in this forum, can someone tell me how to use in my code, i meant how to call it when i want my datagrid to scroll?
thanks
Public Class MyDataGrid
Inherits DataGrid
Public Sub ScrollToRow(ByVal row As Integer)
If Not Me.DataSource Is Nothing Then
Me.GridVScrolled(Me, New ScrollEventArgs(ScrollEventType.LargeIncrement, row))
End If
End Sub
End Class
 
Just call ScrollToRow from your code.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
The key with this code is that instead of using the system.forms.datagrid you need to replace that with the
MyDataGrid

I.E.

if you code looked like
dim x as system.forms.datagrid

change it to
dim x as mydatagrid

and also change any assignments the same way..
(usually at least 2 or 3 places you need to edit int he code that VS builds when you drop a datagrid on the form)



Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top