Link to home
Start Free TrialLog in
Avatar of mustish1
mustish1

asked on

Values only change when i use the mouse

Hi guys: Is there any way I can change these values by means of using the arow keys as right now they only change in the textboxes when I use the mouse.

Thanks

User generated image
    Public Sub Get_Weights(Active_Status)
        DataGridView1.DataSource = "null"
        sDataBaseString(2) = "data source=175.16.64.3;user id=sa;password=;initial catalog=processtwo"
        Dim strConnection As String = sDataBaseString(2)
        Dim cn As SqlConnection = New SqlConnection(strConnection)
        Dim bSource As New BindingSource
        DataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
        Try
            cn.Open()
            query = "select BarcodeType as Tank, Active as Active, Description as Description, ContractWeight as 'Contract Weight', ComponetWeight as 'Component Weight', WatchTolerance as 'Watch Tolerance', LimitTolerance as 'Limit Tolerance', convert(float, ComponetWeight)+convert(float, ContractWeight) as 'Target Weight' from Weights " & Active_Status
            command = New SqlCommand(query, cn)
            sda.SelectCommand = command
            sda.Fill(dbDataSet)
            bSource.DataSource = dbDataSet
            DataGridView1.DataSource = bSource
            'sda.Update(dbDataSet)
            command = New SqlCommand(query, cn)
            reader = command.ExecuteReader
        Catch ex As SqlException
            MessageBox.Show(ex.Message)
        Finally
            cn.Dispose()
        End Try

    End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mike Eghtebas
Mike Eghtebas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial