Hello, I have a question that I can't solve.
There is Grid, TextBox.In the TextBox, I can enter values, a search occurs in TextBox.InteractiveChange(everything works here).
After searching, a record in the grid is highlighted.
Created a function in grid.AfterRowColChange: by clicking on the cell n of the column and m of the row, the value is transferred to the TextBox.(Everything works)
Troubles occur when clicking on a field in the Grid, the value enters the TextBox (ProgrammaticChange is triggered). Then I change the value in the TextBox, InteractiveChange fires and the Grid changes. The best match is at the top and HIGHLIGHTED
Then I click on another line and AfterRowColChange is triggered AND the value that was in the top goes to the TextBox and I moved to the place that I clicked on
There was such an error when I cleared the TextBox and the Grid accepted the Source Table, then I transferred the focus (ThisForm.Grid1.column8.text1.Setfocus) and everything worked. I understand that this is a crutch, at that time I didn’t come up with anything better
It's strange, but if this sequence of actions is carried out twice, then the TextBox does not change the second time.
There is Grid, TextBox.In the TextBox, I can enter values, a search occurs in TextBox.InteractiveChange(everything works here).
After searching, a record in the grid is highlighted.
Created a function in grid.AfterRowColChange: by clicking on the cell n of the column and m of the row, the value is transferred to the TextBox.(Everything works)
Code:
ValueField = ThisForm.grid1.value
ColumnActive = ThisForm.grid1.ActiveColumn
GetFieldValue(ThisForm, ValueField)
FUNCTION GetFieldValue(myform, fieldGrid)
SelectCaption = 'myform.Grid1.column'+ALLTRIM(STR(columnactive))+'.header1.Caption'
DO CASE
CASE &SelectCaption == 'case1'
myform.sNaim.value = (fieldGrid)
InputN = (fieldGrid)
CASE &SelectCaption == 'case2'
myform.sKpost.value = (fieldGrid)
InputKP = (fieldGrid)
CASE &SelectCaption == 'case3'
myform.sOdse.value = (fieldGrid)
InputOdse = (fieldGrid)
CASE &SelectCaption == 'case4'
myform.sOdse.value = (fieldGrid)
InputOdse = (fieldGrid)
ENDCASE
ENDFUNC
Troubles occur when clicking on a field in the Grid, the value enters the TextBox (ProgrammaticChange is triggered). Then I change the value in the TextBox, InteractiveChange fires and the Grid changes. The best match is at the top and HIGHLIGHTED
Then I click on another line and AfterRowColChange is triggered AND the value that was in the top goes to the TextBox and I moved to the place that I clicked on
There was such an error when I cleared the TextBox and the Grid accepted the Source Table, then I transferred the focus (ThisForm.Grid1.column8.text1.Setfocus) and everything worked. I understand that this is a crutch, at that time I didn’t come up with anything better
It's strange, but if this sequence of actions is carried out twice, then the TextBox does not change the second time.