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.


Pick up the single column single row value to a textbox.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-06-2008, 07:18 AM
Senior Member
 
Join Date: Mar 2008
Posts: 117
Default Pick up the single column single row value to a textbox.

I have a single column single row table and want to pick up the column value to a textbox by clicking on it. I failed to do the same. If I add another column, select the second column value first and then the first column value then it works. Please help.


regards,
Attached Files
File Type: sbp test.sbp (720 Bytes, 6 views)
Reply With Quote
  #2 (permalink)  
Old 05-06-2008, 11:21 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 812
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

In your case, the only cell you have is selected by default.
Clicking on an already selected cell does not trigger the Table1_SelectionChanged event.

Even in your example with the 2 columns, if you click on the first cell nothing happens.
If you really need to display the content of this only cell in the TextBox you must do it with an extra code line during initialization of the table.

To show this you can add in your test code at the end of the App_Start routine.
table1.SelectCell("Column1",0)
nothing happens.

If you change it to
table1.SelectCell("Column2",0)
the Table1_SelectionChanged is triggerd
and the second cell content is transfered.

Best regards
__________________
Klaus
Switzerland
Reply With Quote
  #3 (permalink)  
Old 05-06-2008, 11:41 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,334
Default

You can use the Click event instead of the SelectionChanged event.
Table - MouseDown event and more
Reply With Quote
  #4 (permalink)  
Old 05-06-2008, 03:04 PM
willisgt's Avatar
Senior Member
 
Join Date: Aug 2007
Location: Nacogdoches, Texas USA
Posts: 164
Default

As an alternative - you could create a second column of width zero (hidden). When the table is created, set one of the cells in the zero-width column as the selected cell. In the SelectionChanged routine, you should also set the selected cell to the zero-width cell on the same row. This ensures that no matter what cell you click on, the SelectionChanged event gets raised.

Make sense?

Gary
__________________
PC: Windows XP Pro SP3 / Basic4PPC v6.5
PPC: HTC 8925 (AT&T Tilt) / Windows Mobile 6
Reply With Quote
  #5 (permalink)  
Old 05-07-2008, 06:24 AM
Senior Member
 
Join Date: Mar 2008
Posts: 117
Default

Thank you all. I opted the willisgt's solution.

Best regards,
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
Appending a hidden column mozaharul Questions & Help Needed 3 05-14-2008 04:48 PM
Column names in a table pmu5757 Questions & Help Needed 2 05-07-2008 03:50 PM
Tables - column position LineCutter Questions & Help Needed 6 02-22-2008 03:30 PM
Remove Column derez Bug Reports 1 11-01-2007 06:16 PM
is a single character string a number as well? Stellaferox Questions & Help Needed 16 06-08-2007 12:01 PM


All times are GMT. The time now is 12:57 PM.


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