Thinker

Personal e-notepad


    【DataGridView-Highlight】-pAfterAddRefresh

    markeloff
    markeloff
    无尽星空

    帖子数 : 244
    积分 : 3642
    威望 : 0
    注册日期 : 2011-09-06
    年龄 : 31
    地点 : Singapore

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

    Post by markeloff on 20/09/11, 09:41 am

    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
    水面上的小草

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

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

    Post by Aueeins on 20/09/11, 11:16 am

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

      Current date/time is 05/06/20, 09:17 pm