SBO列排序 grid

 

'全局变量:
    '排列的列名
    Public sSortedColID As String = ""

    '排列的顺序: ASC - 升,DESC - 降
    Public sOrder As String = "ASC"

    'Grid的查询语句
    Public sQuery As String = "select CardCode, CardName, DocDate, DocNum, DocTotal, DocStatus from OINV order by {0} {1}"

'处理Grid双击事件
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
If FormUID = "frmGrid" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_DOUBLE_CLICK And pVal.BeforeAction = True And pVal.Row = -1 Then
            If Not pVal.ColUID.Equals(sSortedColID) Then
                '上次排序的列名与双击排序的列名不同
                sOrder = "ASC"
                sSortedColID = pVal.ColUID
                oGrid.DataTable.ExecuteQuery(String.Format(sQuery, sSortedColID, sOrder))
            Else    '双击的是同一列,则更改排列顺序
                If sOrder = "ASC" Then
                    sOrder = "DESC"
                Else
                    sOrder = "ASC"
                End If

                oGrid.DataTable.ExecuteQuery(String.Format(sQuery, sSortedColID, sOrder))
            End If

            '只处理一次
            BubbleEvent = False
        End If
End  Sub

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值