移动行怎么麻烦吗?我这样你参考一下Dim dtb As New DataTableBuilder("列设置") '增加临时表绑定
dtb.AddDef("顺序", Gettype(Integer))
dtb.AddDef("_SortKey", Gettype(Double))
dtb.AddDef("_Identify", Gettype(Integer))
dtb.AddDef("列名称", Gettype(String), 30)
dtb.AddDef("列宽", Gettype(Integer))
dtb.AddDef("显示", Gettype(Boolean))
du1.Table.DataSource =dtb.BuildDataSource()
Dim du1 As WinForm.Table = e.Form.Controls("Table1")
Select Case e.StripItem.Name
Case "下移"
If du1.Table.Current IsNot Nothing Then
du1.Table.Current.Move(du1.Table.Position + 1)
End If
For Each dt As Row In du1.Table.Rows
dt("顺序")= dt.Index+1
Next
Case "上移"
If du1.Table.Current IsNot Nothing Then
du1.Table.Current.Move(du1.Table.Position - 1)
End If
For Each dt As Row In du1.Table.Rows
dt("顺序")= dt.Index+1
Next
主要的是要增加_SortKey列