cancel
Showing results for 
Search instead for 
Did you mean: 

Global function SortCollection()

Creator
Creator

Hello

   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
SortCollection(Me.QuoteDocuments(i).Properties(“SortOrder”))
Next i

Rulestream ETO Version 8.12.0.7556
Solid Edge ST7
4 REPLIES

Re: Global function SortCollection()

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

Re: Global function SortCollection()

Genius
Genius

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")
	col_ret.Add(item)
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()

Creator
Creator

thanks Yuri

Here are my other attempts:

'SortCollection(Me.QuoteDocuments(Me.IndexQuote))
'SortCollection(Me.QuoteDocuments.Properties(“SortOrder”))
'SortCollection(Me.QuoteDocuments(“SortOrder”))
'SortCollection(Me.QuoteDocuments)
'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.

John

Rulestream ETO Version 8.12.0.7556
Solid Edge ST7

Re: Global function SortCollection()

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