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.


Listview and SelectionChanged


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-03-2007, 08:54 AM
Junior Member
 
Join Date: May 2007
Posts: 43
Question Listview and SelectionChanged

Hi,
exists the way to know when it changes the row selected in one treeview?

magi6162
Reply With Quote
  #2 (permalink)  
Old 09-03-2007, 03:39 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 611
Default

Hi,

as far as I know: Yes and no...

If you implement a sub
Code:
Sub listView_SelectionChanged
    ...
End Sub
this sub is called, when a different cell is selected (or a different row on FullRowSelect).
BUT this event is not documented yet, because it is a little buggy. After selecting a different cell or row, the SelectionChanged sub is called twice most of the time. If this doesn't matter in your application, I think you can use it.

@ Filippo
If you read this thread, please check why the SelectionChanged event behaves buggy like this. Maybe you can fix it!


specci48
Reply With Quote
  #3 (permalink)  
Old 09-03-2007, 03:53 PM
Junior Member
 
Join Date: May 2007
Posts: 43
Default

thanks!
Reply With Quote
  #4 (permalink)  
Old 09-03-2007, 05:55 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,964
Default

Quote:
Originally Posted by magi6162 View Post
exists the way to know when it changes the row selected in one treeview?
I guess you mean ListView ?
Reply With Quote
  #5 (permalink)  
Old 09-04-2007, 06:03 AM
Junior Member
 
Join Date: May 2007
Posts: 43
Default

yes

magi6162
Reply With Quote
  #6 (permalink)  
Old 09-05-2007, 08:47 AM
Junior Member
 
Join Date: May 2007
Posts: 43
Default

the SelectionChanged sub is called twice most of the time.

exists a workaround?

magi6162
Reply With Quote
  #7 (permalink)  
Old 09-05-2007, 10:20 AM
Filippo's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 216
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hello magi6162,

look please under this link:
New Listview Library (with source)

An example is included here: TestListview.zip

Ciao,
Filippo
__________________
PPC: MDA Pro, 2GB SD
PPC: HTC Touch Diamond, 4GB
______________________
Reply With Quote
  #8 (permalink)  
Old 09-05-2007, 02:27 PM
Junior Member
 
Join Date: May 2007
Posts: 43
Default

Already seen, but it does not explain nothing.

magi6162
Reply With Quote
  #9 (permalink)  
Old 09-05-2007, 03:04 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 611
Default

Hello magi6162,

as the SelectionChanged event is not always called twice, even a separate counter wouldn't solve this problem. So I think the only way is to fix the bug in the dll...


@Filippo again: Please read this thread carefully and post a small answer if you can/can't/will/won't fix this bug in your dll. As an alternative you can post your actual source code (which includes your last additions) so someone else could be so cute to fix the bug. Thanks!


specci48
Reply With Quote
  #10 (permalink)  
Old 09-05-2007, 03:52 PM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Greece
Posts: 353
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi,

I didn't test the ListView but... listen to my thoughts.

Why don't you keep the selected row number in a global B4PPC variable and every time the event SelectionChanged fires, check if the selected row is the same as the previous selected row.

If it is, then this should be the second (false) event. So ignore it.
__________________
Dimitris Zacharakis
http://www.terracom.gr
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
Keypress and SelectionChanged.. robee9931 Questions & Help Needed 1 05-27-2008 03:08 PM
SelectionChanged problem skipper Questions & Help Needed 4 04-09-2008 01:26 PM
table: SelectionChanged() and SelectedRow stbi Questions & Help Needed 7 12-21-2007 03:14 AM
SelectionChanged work in desktop, but not in ppc?? laiyilam Questions & Help Needed 1 09-10-2007 12:52 PM
Showing a form in a SelectionChanged event specci48 Questions & Help Needed 3 05-18-2007 02:05 PM


All times are GMT. The time now is 11:50 PM.


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