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 » Retreiving data from sorted GridCtrl
Re: Retreiving data from sorted GridCtrl [message #37106 is a reply to message #37103] Thu, 23 August 2012 19:34 Go to previous messageGo to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Hello, Nick, Uno.

unodgs wrote on Thu, 23 August 2012 10:09

Use:
Item& GetItem(int n, int m)
n is a row number related to sort order used to paint the grid.

The GridCtrl::Item& GetItem(int n, int m) method of GridCtrl is private. Did you mean GridCtrl::Item& GridCtrl::GetCell(int n, int m) method?
nixnixnix wrote on Wed, 22 August 2012 23:09

When I sort a GridCtrl, I find I can still retrieve data by the original row number for the Ctrls that I have added myself as, of course, they can be accessed by their original index in my Array of Ctrl objects. However, I do not see how to access data that is just sitting in the GridCtrl itself and that is not longer in its original row due to sorting. I know there must be a way to do this already but how?

In case of manually created Ctrls inside of Array and assigned to GridCtrl through GridCtrl::SetCtrl method, there is also possible to use int GridCtrl::GetRowId() const or int GridCtrl::GetRowId(int n) const public methods to get "original index" for selected or appropriate row. Then you could use it for Array of unsorted Ctrl objects.

There are also Ctrl *GridCtrl::GetCtrl(int c) and Ctrl *GridCtrl::GetCtrl(int r, int c) methods to access Ctrl object through pointer:
Toggle Spoiler


Edit: Clarified some moments.

[Updated on: Thu, 23 August 2012 21:54]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DropGrid .t file
Next Topic: SetDisplay, which works for column why not for cells ??
Goto Forum:
  


Current Time: Thu May 09 22:35:26 CEST 2024

Total time taken to generate the page: 0.02415 seconds