Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Deleting more than one selected records in ArrayCtrl
Deleting more than one selected records in ArrayCtrl [message #14700] |
Sun, 09 March 2008 19:40 |
zsolt
Messages: 698 Registered: December 2005 Location: Budapest, Hungary
|
Contributor |
|
|
In current implementation (last beta), if user selects more than one rows (in multiselect mode), "Delete row" deletes only one of the selected rows.
I would change this code from
bool ArrayCtrl::DoRemove()
{
if(IsReadOnly()) return false;
if(!IsCursor() || askremove && !PromptOKCancel(RowFormat(t_("Do you really want to delete the selected %s ?"))))
return false;
Remove(cursor);
WhenArrayAction();
return true;
}
to
bool ArrayCtrl::DoRemove()
{
if(IsReadOnly()) return false;
if(!IsCursor() || askremove && !PromptOKCancel(RowFormat(t_("Do you really want to delete the selected %s ?"))))
return false;
if(multiselect) {
for(int i=GetCount()-1; i>=0; i--){
if(IsSelected(i)){
Remove(i);
}
}
}
else
Remove(cursor);
WhenArrayAction();
return true;
}
|
|
|
|
Goto Forum:
Current Time: Sat Jun 08 20:36:03 CEST 2024
Total time taken to generate the page: 0.01817 seconds
|