Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
zsolt is currently offline  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;
}
Re: Deleting more than one selected records in ArrayCtrl [message #14702 is a reply to message #14700] Sun, 09 March 2008 20:36 Go to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Thanks, applied.

Mirek
Previous Topic: SqlArray bad select?
Next Topic: Hiding column's header in GridCtrl
Goto Forum:
  


Current Time: Sat Jun 08 20:36:03 CEST 2024

Total time taken to generate the page: 0.01817 seconds