cancel
Showing results for 
Search instead for 
Did you mean: 

how to clear data from datawindow?

Former Member
0 Kudos

suppose I have a datawindow.

I need to do following for data on this datawindow:

retrieve data from database:     //use datawindow.Retrieve()

delete all data retrieved           // How to do this? need to delete all rows from data by loop and then call Datawindow.Update()??? any simple way?

Insert new data to datawindow and save it  //use datawindow.insertRow and then call DataWindow.Update()

what's the simple way to do this job?

View Entire Topic
Former Member
0 Kudos

You can use RowsMove Method. For example:

dw_1.RowsMove(1, dw_1.RowCount(), Primary!, dw_1,1, Delete!)

That will move the rows from the primary buffer to delete buffer and the rows are marked for deletion.

When you call dw_1.Update(), the rows in the Delete! buffer will be deleted.

Then you call dw_1.Reset() to clear the datawindow control.

Check on the RowsMove datawindow method for more details.