Forums: How to insert a subheader between groups of records - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to insert a subheader between groups of records

#1 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15880
  • Joined: 03-February 03

Posted 21 September 2017 - 04:40 PM

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:

Posted Image


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"];
}

Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic