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 » Howto: Row Aggregation for ArrayCtrl
Howto: Row Aggregation for ArrayCtrl [message #12856] Thu, 22 November 2007 07:58 Go to next message
kfeng is currently offline  kfeng
Messages: 18
Registered: July 2007
Location: Tokyo, Japan
Promising Member
Hi,

What is the best approach to provide Row Aggregation functionality in ArrayCtrl?

Suppose I have five rows (ignore ... - didn't know how to embed a space):

A B C
> 1 2 3
...1 5 6
> 2 3 5
...2 3 7
...2 3 2

I want to be able to click on some TreeCtrl-like arrow > and collapse the results into some aggregation after two clicks.

A B C
^ 1 7 9
^ 2 3 14

Rows A=1 has summed columns B and C (Aggregate by A)
Rows A=2, B=3 has summed column C (Aggregate by A,B)

This kind of functionality probably adds a lot of complexity to a class so if someone can suggest an approach (which methods should I focus on?) to how I would best implement this in an extended class, I would greatly appreciate it - or if someone has an example, that would even be better!

Thank you.

Regards,
Ken

[Updated on: Thu, 22 November 2007 08:05]

Report message to a moderator

Re: Howto: Row Aggregation for ArrayCtrl [message #12876 is a reply to message #12856] Fri, 23 November 2007 23:16 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kfeng wrote on Thu, 22 November 2007 01:58

Hi,

What is the best approach to provide Row Aggregation functionality in ArrayCtrl?

Suppose I have five rows (ignore ... - didn't know how to embed a space):

A B C
> 1 2 3
...1 5 6
> 2 3 5
...2 3 7
...2 3 2

I want to be able to click on some TreeCtrl-like arrow > and collapse the results into some aggregation after two clicks.

A B C
^ 1 7 9
^ 2 3 14

Rows A=1 has summed columns B and C (Aggregate by A)
Rows A=2, B=3 has summed column C (Aggregate by A,B)

This kind of functionality probably adds a lot of complexity to a class so if someone can suggest an approach (which methods should I focus on?) to how I would best implement this in an extended class, I would greatly appreciate it - or if someone has an example, that would even be better!

Thank you.

Regards,
Ken




IMO, the possible approach is to introduce a column with widgets that act as that arrow and alter the content on each click.

Of course, if the array is large, can be slow...

(Other than that, I am afraid that such requirement exceeds ArrayCtrl flexibility...)

Mirek
Previous Topic: RemoveLast() crash when cell selected
Next Topic: SqlCtrl accessing
Goto Forum:
  


Current Time: Sun Apr 28 23:51:32 CEST 2024

Total time taken to generate the page: 0.04366 seconds