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.

Combobox in editable table

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-19-2008, 10:02 PM
Junior Member
 
Join Date: Jul 2008
Posts: 15
Default Combobox in editable table

Is There a way to have an editable table with comboboxes?

Ron
Reply With Quote
  #2 (permalink)  
Old 11-20-2008, 11:47 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

The straight answer would be YES...
Take EREL's editable table and replace the textbox with a combobox, but would render ALL the edi fields to be a combobox....
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #3 (permalink)  
Old 11-20-2008, 03:32 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

This is the editable table: http://www.basic4ppc.com/forum/code-...e-desktop.html
Reply With Quote
  #4 (permalink)  
Old 11-20-2008, 11:34 PM
Junior Member
 
Join Date: Jul 2008
Posts: 15
Red face Editable table with textboes and comboboxes

Hi,

Thanks for your responses. I guess what I should have asked is, can I have some text boxes and some comboboxes in an editable table? If so, where do I insert the comboboxes in the code? I am trying to generate a data entry form that has both text boxes and comboboxes in the table.

TIA,

Ron
Reply With Quote
  #5 (permalink)  
Old 11-21-2008, 08:02 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

I've updated it and it now supports ComboBoxes as well as some other new features.
http://www.basic4ppc.com/forum/code-...e-desktop.html
Reply With Quote
  #6 (permalink)  
Old 11-21-2008, 12:13 PM
Junior Member
 
Join Date: Jul 2008
Posts: 15
Question

Erel,

I've looked at editabletable2, but I'm new with Basic4ppc and am not sure where or how to change the code to have some columns be textboxes and some comboboxes. Any help would be greatly appreciated.

Ron
Reply With Quote
  #7 (permalink)  
Old 11-21-2008, 12:29 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

It was not clear enough in my example.
Code:
Sub App_Start
 ...
    EditableTable.SetEdit(
"Main.Table2","","Main.SetCombo")
End Sub

'column - Selected column
'
combo - The combobox control that you should edit
'
value - The value of the current selected cell
Sub SetCombo(column, combo, value)
    Control(combo,ComboBox).Clear
    
Select column
        
Case "Days"
            Control(combo,ComboBox).Add(
"Sunday")
            Control(combo,ComboBox).Add(
"Monday")
            Control(combo,ComboBox).Add(
"Tuesday")
            Control(combo,ComboBox).Add(
"Wednesday")
            Control(combo,ComboBox).Add(
"Thursday")
            Control(combo,ComboBox).Add(
"Friday")
            Control(combo,ComboBox).Add(
"Saturday")
            Control(combo,ComboBox).SelectedIndex = 
0
            
Return True
        
Case "IsRainy"
            Control(combo,ComboBox).Add(
"True")
            Control(combo,ComboBox).Add(
"False")
            Control(combo,ComboBox).SelectedIndex = 
0
            
Return True
        
Case Else
            
Return False
    
End Select
End Sub
First, when you call Editable.SetEdit, the third parameter should be the name of a sub that will handle the combobox and textbox.

Now in this sub (SetCombo in my example) we receive the column name and we decide if we want a textbox or a combobox.
If you want a combobox you should return true.
So we test the current selected column. If it is 'Days' or 'IsRainy' then we fill the combobox (that was passed as a parameter) with the values we need and return true.
Otherwise we return false.
Note that the names of the columns are case-sensitive.

I hope that it is more clear now.
Reply With Quote
  #8 (permalink)  
Old 11-21-2008, 01:31 PM
Junior Member
 
Join Date: Jul 2008
Posts: 15
Talking The light is coming on!

Erel,

Thanks! I didn't catch your link to the updated file at first. My dim light bulb is starting to get a little brighter. I think I can figure it out now.

Thanks a lot!

Ron
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
Editable Table - Device & Desktop Erel Code Samples & Tips 27 01-15-2010 10:42 PM
Editable table davelew1s Questions (Windows Mobile) 6 06-18-2008 03:06 PM
XYCalc -graphs an equation or editable table of figures in regular, bar or pie chart HarleyM Code Samples & Tips 2 11-24-2007 07:21 AM
Editable Table RandomCoder Code Samples & Tips 3 06-29-2007 10:17 PM
editable table ? giannimaione Questions (Windows Mobile) 2 05-13-2007 10:34 AM


All times are GMT. The time now is 07:56 AM.


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