Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Change default sorting in BizForm data view View modes: 
User avatar
Member
Member
K2 - 11/4/2010 6:25:22 AM
   
Change default sorting in BizForm data view
Hi,

When viewing BizForm data in CMSDesk it shows most recently inserted records last. Is it possible to change the sorting to make the most recent records appear on the top of the list?

Thank you.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 11/4/2010 7:46:50 AM
   
RE:Change default sorting in BizForm data view
Hi,

You can sort your BizForm entries by clicking on appropriate column title. It will sort it in DESC or ASC direction.

Whether you wish to sort it by default, it would be quite difficult. You can change '\CMSDesk\Tools\BizForms\BizForm_Edit_Data.aspx.cs' file.

You can add following bold line into Page_Load method:


if (dci != null)
{
className = dci.ClassName;
formName = bfi.FormName;

// Get columns names
columnNames = FormInfo.GetColumnNames();

// Get primary column name
gridData.OrderBy = primaryColumn = GetPrimaryColumn(FormInfo, formName);
gridData.OrderBy = gridData.OrderBy + " DESC";
}


Best regards,
Ivana Tomanickova