Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple Delete in grid
#1
Hello Gintaras,
I may be missing something easy hear but I don't see how if you used the right click delete menu in a qm grid to find out the information that was deleted i.e. since you didn't do a RowsSelectedGet statement, how can you know what was selected/deleted?

Thanks,
S
#2
Grid control just sends single notification GRID.LVN_QG_CHANGE after row(s) deleted, inserted etc. Does not say what items deleted etc.
It is possible to get deleted items if you use item param property (see RowPropSet, RowPropGet). I can give example, but I need to know for what purpose you need to know deleted items.
#3
thanks so much, Gintaras.
I have set up my grid so that the user edits the items in the fields and there is an update of the db3 of the edited row's contents (via a sqlite UPDATE statement) whenever there is case LVN_ENDLABELEDIT. Since only a portion of the database is shown at any one time in the grid (a select on one of the db columns), I don't think I can simply use Sqlite.FromQmGrid after a multiselect delete statement because that will only add the new elements from the grid but won't update pre-existing edited rows or remove deleted rows.

Alternatively, I could just turn off the right click delete menu or the ability for the user to delete/add rows and just control that myself through dlg buttons (add row, delete selected, etc) but I would like to preserve the ability for the user to click on a blank cell and get a new item to start typing into.

S
#4
Too difficult to track everything. User can add, delete, replace, copy/paste multiple rows everywhere, like in a multiline text control.

Even if you disable adding/deleting rows, user still can cut/copy/paste (replace contents of) rows, and you don't know which rows replaced.

You need to somehow change the way you update database, or need a better grid control.
#5
I know the original row contents from the Begin Edit, so I either update the contents of a complete row in the db3 upon End Edit or if there is a new complete set of row elements, add a new row entry to db3. With adding/deleting rows diasbled, cut/copy/paste only seems to work on a cell by cell basis which triggers the Begin Edit/End Edit's properly as above. I think it's working. Will post code later.
S
#6
also, I think it is doable, because there are only three columns in my db and a grid row has to have all three elements not empty to be updated or entered into the db.
S


Forum Jump:


Users browsing this thread: 1 Guest(s)