Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
8
Erster Beitrag:
vor 4 Jahren, 9 Monaten
Letzter Beitrag:
vor 4 Jahren, 9 Monaten
Beteiligte Autoren:
Ian Cordingley, Allard, Yogi Yang, Fabrice Harari, Peter Holemans, Adri, Ian Cordiongley

Related Data on a Form

Startbeitrag von Ian Cordiongley am 12.07.2013 13:13

Hi Folks

Sorry to be a pain but attempting to grasp some of the basics with WD.

I have a form (or is it a window???) and I have a table of data displayed on it.

Is there a simple way to then display an edit control showing a single column from that table, where the row is selected? So the entry in the control changes as the table is navigated.

Seems like the form should have some data binding, or at least the edit control should have a property to bind it to the table???

What am I missing, perhaps a query to populate the control based on a variable itself populated by the record selection in the table?

Antworten:

Hi Ian,

You can simply use the Link option in the edit control description.
Or you can assign the value in the table code 'row display'

Cheers,

Adri

von Adri - am 12.07.2013 13:27
Thanks for the feedback Adri

Could you expand on it a little please?

>>You can simply use the Link option in the edit control description.

Where I set the link to the data in the analysis on the Edit_control then there is no communication between the form Table_control and the Edit_control - the control does not change as the table is navigated???

>>Or you can assign the value in the table code 'row display'

Whee is that set? Could you give me basic example?

von Ian Cordingley - am 12.07.2013 13:33
Hi,

Simple...
BELOW SAMPLE: Direct link to query on form table and edit controls linked to db table
--> On table row is selected event (or left double mouse click if you like) add code
hReadSeekFirst(DBTableName,PUKFieldName,TableName.ColumnWithPUKField)
if hFound(DBTableName) then
FileToScreen(MyWindow,DBTableName)
end

Of course you could also implement this with controls linked to class members in a similar fashion but more easily reusable...


Cheers,

Peter

von Peter Holemans - am 12.07.2013 14:30
Hi

If I understand correctly your question, then you should open the code section of your table, and in the "selection of a line" section, do something like: MyField=MyColumn

Best regards

von Fabrice Harari - am 12.07.2013 15:09
Thanks Peter and Fabrice, I will play with those concepts and code over the weekend.

von Ian Cordingley - am 13.07.2013 11:47
Hi

If you go by the way Peter mentioned . Remember that you bind your form items to the data
With the 7 tabs screen ( discription of the form items ) you can select the binding

filetoscreen() works onley if you bind the form items.

With more coding and no binding you can achief the same thing. You donnot need to do a db search
Int he onrow select section you can add code like this:

formcontrol = table.tablecolum

von Allard - am 13.07.2013 18:54
There is a very good sample available with WinDev. Check out - Sales Management Example.

HTH

Yogi Yang

von Yogi Yang - am 15.07.2013 06:33
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.