selectionchanged in table

pao

Member
I am reviewing the example (table.sbp) found in the samples folder.

Load AccountsData.csv file

If I add:
Sub Table1_SelectionChanged (ColName, Row)
Msgbox (colname)
Msgbox (row)
txtChange.Text = Table1.Cell (ColName, Row)
End Sub

When I click the first row, first columns, not works the event SelectionChanged.

I have checked the forums and can not find a solution that is not an invention of adding rows or columns invisible.

How can I fix this? Is it a bug?
very thanks

How can I fix this? Is it a bug?
 

pao

Member
ok, very clear.

What we should do then, would force the selection in the form OnShow.
something like this:

Table1_SelectionChanged ("COLUMNNAME", 0)
very thanks...
 

efc_dev

Member
Licensed User
Longtime User
1. first you need a Col with 0 width for example cnt
2. a timer
3. a Reset function
4. a Tick function

Sub Globals
Dim TMaktRow ' actual Row in Table
Dim TMaktTable ' string with actuale Tabelname
End sub

' Reset function
Public Sub GridReset(grdName, grdRow)
TMaktRow=grdRow
TMaktTable=grdName
tmGrid.Enabled=True
End Sub

Sub tmGrid_Tick
tmGrid.Enabled=False
' search cell with 0 width
For cnt=0 To Control(TMaktTable,Table).ColCount
' found
If Control(TMaktTable,Table).ColWidth(Control(TMaktTable,Table).ColName(cnt))=0 Then
' select this cell
Control(TMaktTable,Table).SelectCell(Control(TMaktTable,Table).ColName(cnt),TMaktRow)
Exit
End If
Next
End Sub

sub table1_SelectionChanged (ColName, Row)
GridReset("main.table1", Row)
end sub
 
Last edited:

Kintara

Member
Licensed User
Longtime User
I, too, have had problems with the table row already being selected, so cannot fire the SelectionChanged event.
I'll give this a tryand see how it goes. Should work, but I can see a few other issues arrising from it
How long should the timer be set (maybe around 100 (100 miliseconds, 1/10th of a second))
In the TableSelectionChanged routine, there is a need to recognise when the zero width column is selected so as to ignore it, otherwise, it will be acted upon every time the timer ticks.

Kintara
:cool:



April 2013
I have used this method with great success. I have set the timer to fire (once) to select the zero width column of the selected row. Works very well.

Kintara :cool:
 
Last edited:

francisco cobos

Member
Licensed User
Longtime User
Name of the executable “1.exe”

Hello,

I have a problem with the compiled files with Basic4ppc, because my anti-malware software detects that the original name of the executable was “1.exe”.
Is this the normal behavior? Is there a solution?


Thanks in advance
Francisco Cobos
 
Top