Input Array Value to .NET DataGridView PDSOE 11.3

Posted by Robert Timothy on 25-May-2016 22:04

Good Morning All,

I have a migration project to convert (.p) to (.cls) in Progress Developer Studio 11.3,

and stuck for a while with DataGridView.

In earlier program (.p) we use Browse to display things :

DEFINE TEMP-TABLE arl-list

FIELD resstatus              LIKE res-line.resstatus

FIELD l-zuordnung3      LIKE res-line.l-zuordnung[3].

DEFINE VARIABLE stat-list AS CHAR EXTENT 14 FORMAT "x(9)" NO-UNDO.

stat-list[1] = "Status 1"
stat-list[2] = "Status 2".

DEFINE BROWSE b1 QUERY q1 

stat-list[arl-list.resstatus + arl-list.l-zuordnung3] LABEL "ResStatus ".

Meanwhile in PDSOE we use query handle to display things, but the Array Variable doesn't have its own field on TEMP-TABLE. DataGridView data based on query handle which linked to TEMP-TABLE and BindingSource.

Here is some code in PDSOE :

DEFINE VARIABLE qh AS HANDLE NO-UNDO. 

CREATE QUERY qh.
qh:SET-BUFFERS(BUFFER arl-list:HANDLE).
qh:QUERY-PREPARE("FOR EACH arl-list").
qh:QUERY-OPEN ().
BindingSource1:HANDLE = qh.

My question is:

Is it possible to input Array Variable value which is not defined in TEMP-TABLE to DataGridView? which is like Browse in earlier program.

Thank you,

Robert

All Replies

Posted by Laura Stern on 26-May-2016 07:34

You have to do this through the DataGridView control.  I believe there is a way to add a column to the grid that does not come from the BindingSource.  I can't tell you exactly how since I've never done it, but I'm pretty positive you can.  You should be able to figure it out from the design window for the control or look it up in the doc.  But then you obviously also have to supply the values to display at run-time.  The grid will have some event that will fire that you can subscribe to and in the event handler you would return the value you want to display for each column.

Sorry - not so easy as it was with the Browse widget.

Or of course you could add fields to the temp-table whose values come from this array.  Possibly not very practical.

This thread is closed