# order collapsed column into MATRIX

Hi

I have to set a descendent order in the first collapsed column of a matrix

this is the select:

SELECT T0.[Recontact] as [Data Inizio], T0.[ClgCode] as [Nr Attività],T1.[CardCode] as [Cod. BP], T1.[CardName] as [Ragione Sociale BP], T0.[BeginTime] as [Ora Inizio], T0.[ENDTime] as [Ora Fine], (T2.[firstName]+' '+T2.[lastName]) as Consulente, T0.[Action], T3.[Name],T0.[U_FLDF] as [Da Fatt.], T0.[U_CSTH] as [Cst. H.], T0.[U_ORDF] as [Ore Da Fatt.],(CASE T0.[U_FLDF] WHEN 'S' THEN (T0.[U_ORDF]* T0.[U_CSTH]) ELSE 0 END) AS CST_TOT_DAFATT,(T0.[U_ORDF]* T0.[U_CSTH]) AS CST_TOT,T0.[U_KM] as KM

FROM OCLG T0

LEFT JOIN OCRD T1 ON T0.CardCode = T1.CardCode

LEFT JOIN OHEM T2 ON T0.AttendEmpl = T2.empID

LEFT JOIN OCLT T3 ON T0.CntctType = T3.Code

ORDER BY T0.[Recontact] DESC

if I view it whith CollapseLevel=0 it is ok

if I se CollapseLevel=1 it is ordered in ascendent order

how can I solve this problem?

10|10000 characters needed characters exceeded

### Related questions

Posted on Nov 16, 2012 at 01:25 PM

Hi Feliciello,

If you set the matrix column to be sortable then all you'd have to do is double click the header.

Is this an option?

Best regards,

Pedro Magueija

10|10000 characters needed characters exceeded
• Pedro Magueija Feliciello Tiziana

Hi Feliciello,

Loop throught the columns of the matrix and use this:

`Columns cols = oMatrix.Columns;for (int i = 0; i < cols.Count; i++){cols.Item(i).TitleObject.Sortable = true;}`

Good luck.

Best regards,

Pedro Magueija

• Former Member
Posted on Nov 16, 2012 at 02:00 PM

Hi Feliciello,

I suppose you're using a Grid, since Matrix don't have any Collapse property... Beside this, AFAIK, Collapse and Sortable are mutually exclusive.

I would certainly try to "fool" it, by using an hidden column with the correct row order (use the ROW_NUMBER() instruction in your SQL query).

Regards,

Eric