06-08-2026, 04:39 PM
Hello everyone,
I have the following problem:
I create a ListView in a program using
LV = LDDataBase.AddListView(Width, Height)
With
LDControls.ListViewSelectionChanged = ListViewSelectionChanged
the subroutine ListViewSelectionChanged is supposed to be called when a row in the ListView is selected.
With
DBQuerry = LDDataBase.Query(DB, "Select * from " + TableName[BP], LV, "True")
I fill the ListView with all values from the defined table. Two records are present.
The program parts look like this:
SVSC = "False"
LDFocus.SetFocus(TBInput[1][InputText[1]])
Running = "True"
While Running = "True"
Program.Delay(20)
CheckButtonPressed()
CheckListViewSelect()
EndWhile
Program.End()
Sub CheckListViewSelect
If SVSC = "True" Then
SelectedRow = LDControls.LastListViewRow
TextWindow.WriteLine(SelectedRow)
LVValues = LDControls.ListViewGetRow(LV, SelectedRow)
TextWindow.WriteLine(LVValues)
SVSC = "False"
TextWindow.WriteLine("CheckListViewSelect " + SVSC)
EndIf
EndSub
Sub ListViewSelectionChanged
SVSC = "True"
TextWindow.WriteLine("ListViewSelectionChanged " + SVSC)
EndSub
Nothing is printed in CheckListViewSelect.
Does it not work because the ListView was defined using
LV = LDDataBase.AddListView(Width, Height)
?
LitDev, could you please check this and possibly provide a solution?
Thank you
Martin
Show program GXMV538.000
I have the following problem:
I create a ListView in a program using
LV = LDDataBase.AddListView(Width, Height)
With
LDControls.ListViewSelectionChanged = ListViewSelectionChanged
the subroutine ListViewSelectionChanged is supposed to be called when a row in the ListView is selected.
With
DBQuerry = LDDataBase.Query(DB, "Select * from " + TableName[BP], LV, "True")
I fill the ListView with all values from the defined table. Two records are present.
The program parts look like this:
SVSC = "False"
LDFocus.SetFocus(TBInput[1][InputText[1]])
Running = "True"
While Running = "True"
Program.Delay(20)
CheckButtonPressed()
CheckListViewSelect()
EndWhile
Program.End()
Sub CheckListViewSelect
If SVSC = "True" Then
SelectedRow = LDControls.LastListViewRow
TextWindow.WriteLine(SelectedRow)
LVValues = LDControls.ListViewGetRow(LV, SelectedRow)
TextWindow.WriteLine(LVValues)
SVSC = "False"
TextWindow.WriteLine("CheckListViewSelect " + SVSC)
EndIf
EndSub
Sub ListViewSelectionChanged
SVSC = "True"
TextWindow.WriteLine("ListViewSelectionChanged " + SVSC)
EndSub
Nothing is printed in CheckListViewSelect.
Does it not work because the ListView was defined using
LV = LDDataBase.AddListView(Width, Height)
?
LitDev, could you please check this and possibly provide a solution?
Thank you
Martin
Show program GXMV538.000


![[-]](https://litdev.uk/mybb/images/collapse.png)