Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Deleting and Selecting Multiple Rows in a Datawindow.

919 views
Skip to first unread message

vjgp

unread,
Jun 30, 2004, 3:47:48 PM6/30/04
to
Hi All,

I am using PB 9.0. i have a problem, I want to select rows
(number of rows) and delete them (using a command button)
and also if they dont select the rows, if they hit command
button, it should delete all the rows.
any help will be highly appreciated.

Thanks

VJ

Jerry Siegel

unread,
Jun 30, 2004, 4:30:56 PM6/30/04
to
When you do the first GetSelectedRow, it won't find any.
I would put up a confirmation message box before deleting all the rows.

<VJ GP> wrote in message news:40e318e4.378...@sybase.com...

vjgp

unread,
Jun 30, 2004, 4:37:08 PM6/30/04
to
Hi,

I still didn't get what you are telling. Kindly explain with
some code as an example..

Thanks..
VJ GP

Michael Stoffel

unread,
Jun 30, 2004, 4:41:48 PM6/30/04
to
What would you like help with? Multi-selecting the rows them themselves
(PFC makes this a breeze)? Deleting selected rows (loop through using
GetSelectedRow)?

Mike

<VJ GP> wrote in message news:40e3251a.4db...@sybase.com...

philipsalgannik

unread,
Jun 30, 2004, 4:55:05 PM6/30/04
to
In your button do smth like:
boolean lb_filter
dw_1.SetRedraw(FALSE)
lb_filter = Long(dw_1.Describe("Evaluate('sum(if
(IsSelected(),1, 0) for all)',1)")) > 0
IF lb_filter THEN
dw_1.SetFilter("IsSelected()")
dw_1.Filter()
END IF
IF dw_1.RowCount() > 0 THEN
dw_1.RowsMove(1, dw_1.RowCount(), Primary!, dw_1, 1,
Delete!)
END IF
IF lb_filter THEN
dw_1.SetFilter("")
dw_1.Filter()
dw_1.Sort()
END IF
dw_1.SetRedraw(TRUE)

vjgp

unread,
Jun 30, 2004, 5:42:29 PM6/30/04
to
HI All,

Thanks for your sincere effort. It worked fine...

Thanks
VJ

venkatesh....@gmail.com

unread,
Aug 22, 2016, 9:07:54 AM8/22/16
to
This logic also works-

int ll_row

if dw_all_pws.rowcount( ) > 0 then
ll_row = dw_all_pws.GetSelectedRow(0)
if ll_row > 0 then
dw_all_pws.setfilter( "isselected()")
dw_all_pws.filter( )
dw_all_pws.rowsmove(1, dw_all_pws.rowcount(), primary!,dw_all_pws, 1, delete!)
dw_all_pws.setfilter("")
dw_all_pws.filter( )

end if
end if
0 new messages