PowerBuilder Datawindow Grid delete selected rows efficiently

Today I wanted to delete the selected rows of a datawindow grid in Powerbuilder. When I say delete I wanted just to remove them from the screen and not from the database. I used deleteRow(long row) function but it was slow in large datasets. So I asked my departments head and he gave me a very nice and efficient approach:

// move selected rows to Filter Buffer
dw_vehicles.Setfilter("NOT isselected()")
dw_vehicles.Filter()

// move selected rows from Filter to Delete Buffer
dw_vehicles.RowsMove(1,dw_vehicles_noowner.FilteredCount(), Filter!,dw_vehicles_noowner,1,Delete!)

// clear filter
dw_vehicles.Setfilter("")
dw_vehicles.Filter()
Advertisements

About cmanios

programming
This entry was posted in PowerBuilder and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s