Showing results for 
Search instead for 
Do you mean 

Global function SortCollection()


   I am trying to use the SortCollection() function to sort the "SortOrder" column in the DataGridView but I am not having any luck. Does anyone have an example how to use this?

Thanks, John

Here is an example that I tried but is not working:


Dim Quantity As Integer = Me.QuoteDocuments.Quantity

For i As Integer = 1 To Quantity
Next i

Rulestream ETO Version
Solid Edge ST7

Re: Global function SortCollection()

Me.QuoteDocuments(i).Properties(“SortOrder”) is not a Collection, so you can not sort it.

Re: Global function SortCollection()

[ Edited ]

Not fully understand what result you want to get but I suppose that you need to do something like this:


1. To create news connection, name it like SortedQuotes.


2. In the Formula tab you need to write something like.


Dim col_ret As New Collection

For Each item As Object In Me.Subparts("QuoteDocuments")
Next Item

Result = SortObjectsByProperty(col_ret, "SortOrder")

That should be the way to show sorted QuoteDocuments on the UI.

I believe that is your goal.

Not sure that the synthax is 100% correct.

Re: Global function SortCollection()

thanks Yuri

Here are my other attempts:

'SortCollection(Me.QuoteDocuments.Properties(“SortOrder”).Value )


Can you see what I am doing wrong? or if you could write an example that would be helpful too.


Rulestream ETO Version
Solid Edge ST7

Re: Global function SortCollection()

oops, just saw your example, will try it.
Rulestream ETO Version
Solid Edge ST7