Hello,
I did a search and added the code below to scroll to the selected row and works. But when I move my mouse over the grid it automatically scrolls to the top of the grid. The row is still selected but why does it do this? Can I do anything about it to stop doing this?
Below is my code. Thanks!
Warren
I did a search and added the code below to scroll to the selected row and works. But when I move my mouse over the grid it automatically scrolls to the top of the grid. The row is still selected but why does it do this? Can I do anything about it to stop doing this?
Below is my code. Thanks!
Warren
'Bind Grid Here
Dim ConnString7 As String = "Server=xxxxx;Database=xxxxx;User Id=xxxxx;Password=xxxxx;"
Dim SQLConn As New SqlConnection()
Dim SQLCmd As New SqlCommand()
SQLCmd.Connection = SQLConn
SQLCmd.CommandType = CommandType.Text
SQLCmd.CommandText = "Select SpecialInst, OrderID FROM SPP_SpecialInst ORDER BY OrderID"
SQLConn.ConnectionString = ConnString7
SQLConn.Open()
Dim reader As SqlDataReader
reader = SQLCmd.ExecuteReader()
gvSpecialInst.MasterTemplate.LoadFrom(reader)
reader.Close()
SQLConn.Close()
'Settings for selecting a row and the scroll options
Dim ConnString7 As String = "Server=xxxxx;Database=xxxxx;User Id=xxxxx;Password=xxxxx;"
Dim SQLConn As New SqlConnection()
Dim SQLCmd As New SqlCommand()
SQLCmd.Connection = SQLConn
SQLCmd.CommandType = CommandType.Text
SQLCmd.CommandText = "Select SpecialInst, OrderID FROM SPP_SpecialInst ORDER BY OrderID"
SQLConn.ConnectionString = ConnString7
SQLConn.Open()
Dim reader As SqlDataReader
reader = SQLCmd.ExecuteReader()
gvSpecialInst.MasterTemplate.LoadFrom(reader)
reader.Close()
SQLConn.Close()
'Settings for selecting a row and the scroll options
gvSpecialInst.AutoScroll = True
gvSpecialInst.Rows(5).IsSelected =
True
gvSpecialInst.Rows(5).IsCurrent =
True
gvSpecialInst.TableElement.ScrollToRow(gvSpecialInst.Rows(5))