主题:help me (online wait)
yyqheaven
[专家分:0] 发布于 2006-07-09 15:31:00
如何在数据窗口中实现按某一列然后该列的值自动进行排序
回复列表 (共4个回复)
沙发
ericall [专家分:10] 发布于 2006-07-11 17:31:00
定义实例变量
String is_col=''
Int ii_time=0
在数据窗口的clicked事件
String ls_pos,ls_col,ls_format
Long ll_pos
ls_pos = dwo.Name//取点击的对象
ll_pos = Pos(ls_pos,'_t')//对于列标题,取得的对象是列名+”_t”
If ll_pos >0 Then
ls_col = Left(ls_pos,ll_pos -1)
If ls_col=is_col Then
If ii_time=0 Then
ii_time = 1
ls_format = ls_col+" A"
Else
ii_time=0
ls_format = ls_col+" D"
End If
Else
ii_time = 0
ls_format = ls_col+" A"
End If
is_col = ls_col
dw_1.SetSort(ls_format)
dw_1.Sort()
End If
板凳
潇洒老乌龟 [专家分:1050] 发布于 2006-07-18 23:06:00
同意楼上兄台的方法.
3 楼
xmxm [专家分:30] 发布于 2006-07-24 12:37:00
最好还是设置一个通用的排序窗口!
每次调用只要,openwithparm(w_sort,dw_1)
点击行头排序,功能有限(只能实现单种排序),而且繁琐!
对于过滤,查询,替换、查找。。。都可以!
4 楼
岚山 [专家分:320] 发布于 2006-08-28 20:07:00
最好是写成函数,在开发的软件中回经常用到,写成函数每次直接调用就可以了
我来回复