Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculate column on grid
Message
From
29/01/2024 04:13:23
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01687576
Message ID:
01687590
Views:
49
>>Hello community,
>>
>>i created these bindevents for columns 1,5,8,9 so that when i change the value of any of them the procedure can calculate the value of my column13.
>>but it doesn't work!
>>
>>As I'm already getting a headache, can someone help me explain what's wrong and possibly correct the code?
>>
>>Here is the code:
>>
>>PUBLIC oManipulador as Manipulador
>>
>>*!* - Instancia o objeto manipulador
>>oManipulador = CREATEOBJECT("Manipulador")
>>
>>
>>loGrid = SFT.PAGEFRAME1.PAGE1.CONT1.GRID1
>>  
>>* Set the ControlSource for each column
>>*loGrid.Column1.ControlSource = "FI.ALTURA"
>>*loGrid.Column5.ControlSource = "FI.ESPESSURA"
>>*loGrid.Column8.ControlSource = "FI.LARGURA"
>>*loGrid.Column9.ControlSource = "FI.PARTES"
>>
>>
>>* Bind the event to Column1
>>BINDEVENT(loGrid.Column1, "AfterRowColChange", oManipulador, "CalculateTotal")
>>
>>* Bind the event to Column5
>>BINDEVENT(loGrid.Column5, "AfterRowColChange", oManipulador, "CalculateTotal")
>>
>>* Bind the event to Column8
>>BINDEVENT(loGrid.Column8, "AfterRowColChange", oManipulador, "CalculateTotal")
>>
>>* Bind the event to Column9
>>BINDEVENT(loGrid.Column9, "AfterRowColChange", oManipulador, "CalculateTotal")
>>
>>DEFINE CLASS Manipulador AS Session
>>LPARAMETERS nColIndex
>>
>>* Define the event handler method directly
>>PROCEDURE CalculateTotal
>>   ? "CalculateTotal method called"  && No message was return ??
>>      loGrid.Column13.text1.value = VAL(loGrid.Column1.text1.value * loGrid.Column5.text1.value * loGrid.Column8.text1.value * loGrid.Column9.text1.value)
>>
>>ENDPROC
>>enddefine
>>
>>
>>Thanks!
>>Luis
>
>Why BINDEVENT?
>What happens if you set this:
>
>loGrid.Column13.ControlSource = "=(loGrid.Column1.text1.value * loGrid.Column5.text1.value * loGrid.Column8.text1.value * loGrid.Column9.text1.value)"
>
Adding the fields might be even more simple. It was "(" to be used? Thank you. I never remember it.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform