Home » U++ Library support » U++ Widgets - General questions or Mixed problems » DropList / DropGrid
DropList / DropGrid [message #41459] |
Thu, 19 December 2013 09:17 |
crydev
Messages: 151 Registered: October 2012 Location: Netherlands
|
Experienced Member |
|
|
Hello,
I have a question about saving memory with DropList or DropGrid controls. Using the ArrayCtrl I can use an external data source with SetVirtualCount. This is fast and efficient, I love it.
However, can this be done with the controls as described above too? I'd use DropGrid because it looks very nice, but I have to know if it is possible to use an external data source. I tried SetDropLines and SetConvert but this does not seem to work properly.
I need to save my data in a Vector, and if I add the same data to my drop control, I am using unneeded memory.
Regards,
crydev
|
|
|
|
Re: DropList / DropGrid [message #41519 is a reply to message #41496] |
Wed, 25 December 2013 07:01 |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
Hello.
crydev wrote on Sun, 22 December 2013 23:21 | I figured that using the underlying ArrayCtrl maybe it was possible to mangle the displayed values the way I want. However, it doesn't work. Why doesn't it? Is there a way it will work?
|
It doesn't work, because PopUpTable already have added column for DropList. Moreover, the DropList uses keys for values based on Index<Value> container, which adds memory consumption in your case.
To solve this, I created VirtualDropList class based on DropList methods and following example, which you could find in attachments:
[Updated on: Wed, 25 December 2013 23:08] Report message to a moderator
|
|
|
|
Re: DropList / DropGrid [message #41530 is a reply to message #41529] |
Wed, 25 December 2013 22:31 |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
crydev wrote on Wed, 25 December 2013 15:38 | This is exactly what I was looking for. I see how you made use of a SetCount method to create a virtual DropList.
|
You are right, there is a need to use SetVirtualCount method of ArrayCtrl for external data. The attached archive was updated for above message.
Thanks for attention.
[Updated on: Thu, 26 December 2013 00:23] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Apr 26 00:35:09 CEST 2024
Total time taken to generate the page: 1.01314 seconds
|