Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Using ListView


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-10-2008, 02:51 AM
Junior Member
 
Join Date: Dec 2007
Posts: 27
Default Using ListView

I have been playing around with the ListView control library and are having a few hassles that is no doubt a lack of understanding on my part.

What I have tried to find out is how to manipulate the Listview tables to avoid unnecessary load on the CPU or consumption of memory while the application is running. My understanding is that Table and Listview work almost identicle, except that Listview has extra features. (?)

The app' that I am working on utilises two Listview tables. One of them is "invisible" and is populated when the application is started using LoadCSV. This table is regularly accessed and values read, added and removed. So the table itself remains active all the time in the background.

The second Listview table that I have is on a form that is only accessed every now and then. It has the potential to grow into a large table, so my intention is to only load it up when needed and get rid of it as soon as I'm finished with it, so that memory is freed up, etc. During this use the Form and its Table are made visible.

Occassionally though, I need to manipulate this second table without actually viewing the Form that it is on. In these cases I am intending to create the Listview table on its normal form, but not actually Show the form. Once the manipulation is completed, then I once again want to remove it from memory.

My question is how to go about doing all this using the RemoveAllRows, Close, Dispose, etc (or any other) methods. To achieve my goal of easing the load on the CPU and freeing up memory, should I only look at removing the rows (data) but leave the Table intact, or should I be "unloading" (disposing?) everything associated with it.

Which ever path is advisable, what methods should be used and in what order.

I have done heaps of experimentation and I keep coming up with errors when trying to recreate a "disposed" listview (table), or the table not being "repopulated" when using LoadCSV, etc. These problems are only happening when I am trying to access the tables multiple times.

I'm obviously missing some minor key point, but have been unable to put my finger on it.

Any advice will be much appreciated (as always).

Burd.
Reply With Quote
  #2 (permalink)  
Old 03-10-2008, 11:19 AM
Filippo's Avatar
Senior Member
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 198
Default

Hi burd27,

I do not understand so many English, therefore I understand your problem not completely. Please upload part from code, so that I better understand and can help


Ciao,
Filippo
__________________
PPC: MDA Pro, 2GB SD
PPC: HTC Touch Diamond, 4GB
______________________
Reply With Quote
  #3 (permalink)  
Old 03-11-2008, 11:29 AM
Junior Member
 
Join Date: Dec 2007
Posts: 27
Default

Hi Filippo,

I've been playing around with the code just experimenting, so I don't have something containing a specific problem.

Simply, what I would like to know is if I create a ListView table on a non-main form and want to remove it from memory once I've finished with it (without closing the application), how should I do that so that If I want to create it again, that it still works.

At the moment, if I leave the table theer but just RemoveAllRows, when I go back to it later, it won't reload the CSV file. Also, if delete the table totally by using the Dispose method, when I go back to ceate the table I get an error telling me that there is no object.

Let me know if you still want a sample code. If so I write one detailing the problems.

Thank you
Burd
Reply With Quote
  #4 (permalink)  
Old 03-12-2008, 09:55 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by burd27 View Post
Also, if delete the table totally by using the Dispose method, when I go back to ceate the table I get an error telling me that there is no object.
Check this thread Optimised compile and "Dispose" then try using AddObject as suggested by Erel.
Reply With Quote
  #5 (permalink)  
Old 03-13-2008, 01:21 PM
Junior Member
 
Join Date: Dec 2007
Posts: 27
Default

Quote:
Originally Posted by agraham View Post
Check this thread Optimised compile and "Dispose" then try using AddObject as suggested by Erel.
Thanks agraham for the pointer. I now "AddObject" for it in the code for every occassion and that has solved the problem.

It has also given me a better understanding of the methods that I have mentioned earlier.

Much appreciated.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Listview.dll Filippo German Forum 60 08-08-2008 02:35 PM
Listview.dll giannimaione German Forum 4 06-03-2008 08:34 PM
MS ListView enonod Basic4ppc Wishlist 2 04-27-2008 01:16 PM
Listview help jeterry Questions & Help Needed 5 04-18-2008 11:36 AM
Listview mit ContextMenu Filippo German Forum 2 09-17-2007 09:30 PM


All times are GMT. The time now is 02:54 AM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0