Daatagridview - OpenEdge GUI - Sort

balta

Member
Hello,

I am starting in OpenEdge GUI.

When using Datagridview, Sort doesn’t work. It is necessary "supplementary" code to work?

Thanks,
Baltazar
 

TomBascom

Curmudgeon
I'll go out on a limb and guess "Windows" since you mentioned GUI but what version of OpenEdge might you be using?

It is also always helpful to show an example of the code that you are having trouble with. It is much easier to provide helpful suggestions when there is actual code to look at.
 

balta

Member
Yes. Using Windows. OpenEdge 11.7.8

Don´t have code. I think that the sort should be automatic without programming.

Do you any sample code to achieve the sort?

Thanks,
Baltazar
 

TomBascom

Curmudgeon
GUIs don't just appear out of thin air. Directly or indirectly, you have written some code that puts a datagrid on a screen. Maybe you just futzed around with a mouse using an IDE and a visual designer or something but there is code hiding somewhere in there. But if you did just mouse around and click stuff and can't find the code then perhaps you could post a bunch of screen captures showing the various properties and stuff. Or a video of how you created whatever it is that isn't working the way that you want it too. That also might be enough of a clue to get you some help.
 

Osborne

Active Member
As Tom says we require something to look at.

There is a basic example here, and although using all kinds of things you were not looking for it will give you a start:


I have copied the code and adjusted to use a standard System.Windows.Forms.DataGridView and this attached. This will run against the Sports2000 database.

To sort the data, either have a combo box, button or check for any of the columns being clicked and just re-open the query sorting as required. In this example you want to sort by customer name:

Code:
hTopQuery:QUERY-PREPARE("FOR EACH ttCustomer BY ttCustomer.name").
hTopQuery:QUERY-OPEN().
 

Attachments

  • DataGridSort.p
    6.4 KB · Views: 8

balta

Member
Hello,

I have this.

1610010301045.png

1610010661531.png

The DataGridView in Visual Studio works as expected.

In datagridview "native", I have to do programming?

Thanks,
Baltazar
 

Attachments

  • 1610010497987.png
    1610010497987.png
    74.9 KB · Views: 2

Osborne

Active Member
I think you are correct in that you have to do programming when using a DataGridView in Progress.

One solution may be to detect the ColumnHeaderMouseClick event and open the query sorting it based on the column header clicked.

Attached is this example with code added for ColumnHeaderMouseClick:

OpenEdge 11.7 Documentation
 

Attachments

  • QueryBindingSort.p
    2.4 KB · Views: 11

balta

Member
I am looking for an opinion/solution why OE datagridviewer doesn't do the native sort.

The Microsoft datagridviewer do native sort without "custom" code. It just works.
 
Top