Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Treeview - getting the selected branch

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-22-2008, 02:20 PM
Newbie
 
Join Date: Nov 2008
Posts: 2
Default Treeview - getting the selected branch

Hi

I have a tv control that has different branches for different tables in a relational db.
I wish to be able to select any node and then enter a new child value that will also populate the underlying table. The question is, how do I identify which branch is selected and which underlying table that is from.

For example, If I select 'Manufacturer' and then type a new entry (Ford) into a text box, I want that entry to go into tblManufactures which will be reflected when the TV is refreshed, If I then select Ford and add a new entry then I wish for the entry to go into tblCars,but also to trap the primary key from the Ford record to keep the data related.

Root
---Manufacturer
------Ford
---------Focus
---------F150
---------Mustang
---------Explorer
------Ferrari
----------F40
----------F355
---Customers
------Mr Blonde
------Mr Brown
---Staff
------Jim
------Jack
------Paul
------Peter

How can I do this?

Thanks
bb

Last edited by blackbox : 11-22-2008 at 02:23 PM.
Reply With Quote
  #2 (permalink)  
Old 11-22-2008, 09:47 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hello blackbox,

i took the treeview example from the help file and added a simple textbox to add a new node to the current selected node.

If you want to implement much more features to manipulate the treeview (e.g. deleting or moving nodes) you may have a look at my ToDoTree application I posted here some time ago.


specci48
Attached Files
File Type: sbp TreeView.sbp (1.2 KB, 44 views)
Reply With Quote
  #3 (permalink)  
Old 11-23-2008, 12:45 PM
Newbie
 
Join Date: Nov 2008
Posts: 2
Default

Thanks specci48

Your app is great and I'll learn a huge amount from it. I'm now using the SelectedImageIndex property to store the ID from each row of my database in the tv control. That way I can refer back to the specific record. The only snag is that it does not accept Alpha characters. I was hoping that each node on the TV could be assigned a 'key', for example the 3rd record in the Customer table could be 'Cust3' etc. The only way I can see around this is to add a specific number to each record number, so record 3 from the Customers table would be 100000003 and record 3 from the manufactures table would be 200000003. Do you have any other ideas?

Thanks
bb
Reply With Quote
  #4 (permalink)  
Old 11-23-2008, 05:00 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi blackbox,

since the selectedImgageIndex was not originally designed to act as a reference to a specific tablerow, I don't have other ideas for you.
But I think your solution should work well leaving enough space for a lot of tv channels...


specci48
Reply With Quote
  #5 (permalink)  
Old 12-05-2009, 10:35 PM
Newbie
 
Join Date: Nov 2009
Posts: 3
Default

Thank you so much for posting this. This is very useful!
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help shoosing folder & new branch tsteward Questions (Windows Mobile) 2 08-30-2008 08:36 AM
Harware, get selected text from other application levi Questions (Windows Mobile) 3 07-15-2008 12:40 PM
Get and update selected cell in ListView tsteward Questions (Windows Mobile) 5 04-29-2008 03:45 PM
How catch a selected treeview item information by mouse ? dan kabestan Questions (Windows Mobile) 2 01-08-2008 06:30 PM
Tablecell 0 not selected Scubaticus Bug Reports 4 07-30-2007 09:03 PM


All times are GMT. The time now is 03:17 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0