急! 请问怎样解决PB中将在数据窗口中检索出来的多个数据一起删除

bit_hj 2002-03-15 10:46:01
请问怎样解决PB中将在数据窗口中检索出来的多个数据一起删除,最高能让用户选择要删除的记录(不一定是全部)
...全文
104 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
programbcb 2002-03-16
  • 打赏
  • 举报
回复
dw_1.rowsmove(primary!,1,dw_1.rowcount(),delete!,1)
zhanwei 2002-03-16
  • 打赏
  • 举报
回复
都让楼上两位说了,我来说说选中的问题:
实例变量:
boolean ib_action_on_buttonup = false
long il_LastClickedRow

dw clicked()事件
//////////////////////////////////////////////////////////////////////////////////////////////////
// Clicked script for dw_1
//////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////
// This event will be the controlling event for all of the types of
// Highlighting that will be done.
//////////////////////////////////////////////////////////////////////////////////////////////////
string ls_KeyDownType


//////////////////////////////////////////////////////////////////////////////////////////////////
// First make sure the user clicked on a Row. Clicking on WhiteSpace
// or in the header will return a clicked row value of 0. If that
// occurs, just leave this event.
//////////////////////////////////////////////////////////////////////////////////////////////////

//check for a valid row
If row = 0 then Return

//case of select multiple rows range using the shift key
If Keydown(KeyShift!) then
wf_Shift_Highlight(row)
//In filemanager style, the click and ctrl-click events on a selected row take
//place on the button up event.

ElseIf this.IsSelected(row) Then
il_LastClickedRow = row
ib_action_on_buttonup = true

ElseIf Keydown(KeyControl!) then
// (CTRL KEY) keep other rows highlighted and highlight a new row or
// turn off the currint row highlight
il_LastClickedRow = row
this.SelectRow(row,TRUE)

Else
il_LastClickedRow = row
this.SelectRow(0,FALSE)
this.SelectRow(row,TRUE)

End If //selected row
//

DW UE_lbuttonup自定义( id: pbm_dwnlbuttonup)
//////////////////////////////////////////////////////////////////////////////////////////////////
// ue_LButtonUp script for dw_highlight
//////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////
// This event will be the controlling event for all of the types of
// Highlighting that will be done.
//////////////////////////////////////////////////////////////////////////////////////////////////
long ll_ClickedRow
string ls_KeyDownType


//////////////////////////////////////////////////////////////////////////////////////////////////
// First make sure the user clicked on a Row. Clicking on WhiteSpace
// or in the header will return a clicked row value of 0. If that
// occurs, just leave this event.
//////////////////////////////////////////////////////////////////////////////////////////////////


//In filemanager style, the the click and ctrl-click events on a selected row take place
//on the button up event.
If ib_action_on_buttonup Then
ib_action_on_buttonup = false

// (CTRL KEY) keep other rows highlighted and highlight a new row or
// turn off the currint row highlight
If Keydown(KeyControl!) then
this.selectrow(il_lastclickedrow,FALSE)
Else
this.SelectRow(0,FALSE)
this.SelectRow(il_lastclickedrow,TRUE)
End If

//last action was deselecting a row , an anchor row is no longer defined
il_lastclickedrow = 0
End If

fzymr 2002-03-15
  • 打赏
  • 举报
回复
如果是连续的行可以用rowsmove()函数
Whyin 2002-03-15
  • 打赏
  • 举报
回复
1.首先你应该查找到用户选择的行
2.删除:
一行一行判断从后往前删除:
for I = dw.rowcount() to 1 step -1
if dw.IsSelected(row) then
dw.deleterow(I)
end if
end for

401

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 非技术版
社区管理员
  • 非技术版社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧