BusinessBase field order change at runtime (DetailsView)

BusinessBase field order change at runtime (DetailsView)

Old forum URL: forums.lhotka.net/forums/t/949.aspx


pvanroos posted on Friday, August 18, 2006

Hello All,

Does anyone know how to order the fields in the DetailsView at runtime?  I looked at the rows collection and it doesn't have any method like Move().  I am autogenerating the rows at runtime and I need a way to order the fields.  I'm not sure how the CslaDatasource orders the fields on the BusinessBase object.

Thanks,

Paul

RockfordLhotka replied on Wednesday, August 23, 2006

I'm afraid I don't know the answer to ordering fields at runtime - but the solution would be a standard ASP.NET solution, so you might want to ask in an ASP.NET specific forum like www.asp.net.

You can see the details of CslaDataSource in Chapter 5. It uses reflection to scan your busness object type and find all its properties. It does no specific ordering of those properties - the order is really set by the .NET runtime and how reflection returns them. You can never count on any data source to provide proper ordering of columns/fields - it is the job of the UI to control presentation.

pvanroos replied on Wednesday, August 23, 2006

Hi Rocky,

Thanks for the response.

-Paul

Copyright (c) Marimer LLC