1、数据窗口里面根据分组条件生成序号
//做分组组号
cumulativeSum( if( 分组列名 [-1] = 分组列名 [0],0,1) for all )
//做组内编号
GetRow() - First(GetRow() for Group 1) + 1
2、批量选中
全局变量:
long il_lastrow=1 //声明实例变量并置初值(上次点击行)
datawindow的click事件代码:
long i
//l_lastrow=row //将当前行号赋给实例变量
if keydown(keyshift!) then //如果按下Shift键
if row>il_lastrow then
for i=il_lastrow to row
this.selectrow(i,true) //选中当前行和上次单击行之间的所有数据行
next
else
for i=il_lastrow to row step -1
this.selectrow(i,true) //选中当前行和上次单击行之间的所有数据行
next
end if
elseif keydown(keycontrol!) then //如果按下Ctrl键
if this.isselected(row) then //如果当前行被选中
this.selectrow(row,false) //取消选中该行
else
this.selectrow(row,true) //选中该行
end if
else //没有功能键按下
for i=1 to this.rowcount()
this.selectrow(i,false) //取消所有数据行选中
next
il_lastrow=row //将当前行号赋给实例变量
this.selectrow(row,true) //选中当前行
end if
3、将以下代码复制到想要排序的数据窗口的clicked事件中可实现:
//***********************************按标题头排序********************************//
//*****注:为避免点击标题时所在列变黑色,应将数据窗口的column moving属性去掉******//
// 字段列标题名称为 字段名称+"