This topic is locked

How to insert a subheader between groups of records

9/21/2017 12:40:25 PM
ASPRunner.NET Tips and tricks
admin

We'd like to modify the List page displaying subheader between groups of records. For instance we'd like to group our cars by make. Here is how it supposed to look in generated application:


ASPRunner.NET 9.x

Lets assume we have a list page with cars listings ordered by make. We want to insert a group name (Make) in front of each group.

  1. Open List page in Visual Editor and switch to HTML mode
  2. Find the following code snippet

{BEGIN grid_row}


right after {BEGIN grid_row} insert the following code snippet:



{BEGIN showheader}

<TR>

<TD colspan="20">

&nbsp;&nbsp;&nbsp;&nbsp;

<H1 style="padding: 0px 0px 5px 5px; color: rgb(82, 82, 82); font-family: Trebuchet MS, sans-serif; font-size: 150%; font-weight: bold;">

{$subheader}

</H1>

</TD>

</TR>

{END showheader}


3. Add BeforeMoveNextList (List page: After record processed) event:

if(XSession.Session["Make"]!=data["Make"])

{

XSession.Session["Make"]=data["Make"];

row["showheader"]=true;

row["subheader"]=data["Make"];

}