Thinker

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Thinker

Forum for story


2 posters

    【DataGridView-Highlight】-pAfterAddRefresh

    markeloff
    markeloff
    无尽星空


    帖子数 : 322
    积分 : 5172
    威望 : 0
    注册日期 : 2011-09-06
    年龄 : 35
    地点 : Singapore

    【DataGridView-Highlight】-pAfterAddRefresh Empty 【DataGridView-Highlight】-pAfterAddRefresh

    Post by markeloff 2011-09-20, 4:41 pm

    Public Sub pAfterAddRefresh(ByVal pCode As Integer)
    Try
    ' A Temp SQL Code to hold the value for the newly added SQL Code deduct off a specified numbers
    Dim intSqlCodeTemp As Integer = pCode - 100
    Dim strSqlCondition As String = ""

    If intSqlCodeTemp > 0 Then ' When there are more than 100 records
    ' A SQL condition that will refresh the Grid after a new record added which is differ from the intial SQL stt
    strSqlCondition = "AND Code >= " & intSqlCodeTemp
    End If

    ' If there are not more than 100 records then select for all records from the table

    vDs01Department = cls00Connection.getDataSet(vSqlHeaderStr & strSqlCondition & " ORDER BY Code ", vpConnStr)

    dgv01Department.AutoGenerateColumns = False
    dgv01Department.DataSource = vDs01Department.Tables(0)

    Call pClearDataBinding()
    Call pDataBinding()
    Call pRecordCount()

    If pCode <> 0 Then
    cls00Common.PositionRecordInGrid(dgv01Department, pCode)
    End If
    Catch ex As Exception
    MsgBox("<f01Department.pAfterAddRefresh> " & ex.Message)
    End Try
    End Sub
    Aueeins
    Aueeins
    呢喃的歌声


    帖子数 : 205
    积分 : 4987
    威望 : 0
    注册日期 : 2011-09-08
    地点 : SG

    【DataGridView-Highlight】-pAfterAddRefresh Empty Re: 【DataGridView-Highlight】-pAfterAddRefresh

    Post by Aueeins 2011-09-20, 6:16 pm

    Me.PTools.Enabled = Not status
    检查button控制

      Current date/time is 2024-03-29, 1:17 am