I'm retrieving a subset of columns from a typed view, however I want to change the order that I see the columns.
Ex.
The typed view returns columns A, B, C, D, E, F. I'm only interested in columns A, B, C (so I just get these columns), but I want to see them in the order of B, C, A.
Is this possible?
Here is a code sample that i'm using to do this:
Dim ssc As New SearchStakeholderCompanyTypedView
Dim viewBucket As New RelationPredicateBucket
Dim viewExpression As IPredicateExpression = New PredicateExpression
Dim fields As EntityFields2
Dim selectedFields As New EntityFields2(3)
viewExpression.Add( CAAPS.Business.Common.Stakeholder.FactoryClasses.PredicateFactory.CompareValue( CAAPS.Business.Common.Stakeholder.SearchStakeholderCompanyFieldIndex.PartyID, ComparisonOperator.Equal, 104054))
viewBucket.PredicateExpression.Add(viewExpression)
fields = ssc.GetFieldsInfo()
selectedFields(0) = fields.Item("PartyType")
selectedFields(1) = fields.Item("PartyID")
selectedFields(2) = fields.Item("LegalName")
dgDisplay2.DataSource = remoteObj.FetchTypedView(selectedFields, viewBucket, True)
In this case 'ssc' is a typed view that has quite a few columns, but the order of the first 3 columns PartyID, PartyType and LegalName.
I would like them returned back in the above order, instead all that happens is the column headers get changed but the data stays in the same order.
Original Data:
PartyID PartyType LegalName
1 type1 name1
After the code:
PartyType PartyID LegalName
1 type1 name1
Thanks.
Ross.