Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl: Feature Requests
GridCtrl: Feature Requests [message #35878] |
Fri, 30 March 2012 14:10  |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
1. Custom filtering
Use case: In a grid, there is a column called 'age'; the grid has been populated. Then I want to show only rows with ages in certain range. Ideally, GridCtrl will provide a method Filter(); it takes a Gate that will allow user program to test if a row should be filtered out. It's very similar to what Search with search-hide-rows do, but allowing for callback.
Maybe this feature is already there, just I don't know how to use it.
2. Custom sorting
Clicking column header to sort is very handy. Unfortunately sometimes it doesn't demonstrate desirable behavior. E.g., the sorting issue I mentioned in an earlier post. And sometimes, a column might be combined from many pieces of data(because it's more screen space efficient to combine them together). In these cases, more flexible sorting is desirable. A Sort() that accepts callback will fix the issue.
3. External data
The only thing I missed from ArrayCtrl is the capability to use external data (SetVirtualCount, etc). There are times that I'd love to have GridCtrl to ask me:"I know you have a total of 100 rows, I am now drawing the 36th row, can you tell me the datum in the 1st column of the row so that I can render it for you? and the 2nd column..."
I think it might be reasonable to insert an intermediate class in the class hierarchy, maybe a GridCtrlBase which has virtal functuions like:
virtual void SetCount(int newcount)=0;
virtual int GetCount()=0;
virtual Value Get(int row, int col)=0;
virtual void Set(int row, int col, Value value)=0;
And GridCtrl, like what it is current doing, provides built-in storage and implements these functions accordingly.
[Updated on: Fri, 30 March 2012 14:19] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Apr 30 00:31:52 CEST 2025
Total time taken to generate the page: 0.00509 seconds
|