How to create tables with sections and headers in ASP.NET?

I have some data that should be presented in the form of tables with several sections. In particular, each data section is divided (with its own headers) per day. This is basically a one-time one-page deal, and in fact it won’t support it, so I don’t want to put a lot of effort into the architecture.

I have two tables. LEADERS AND ITEMS.

HEADERS has a format:

date(datetime), type(tinyint), firstline(varchar), secondline(varchar)

ITEMS has a format

id(int), date(datetime), type(tinyint), name(varchar), value1(int), 
    value2(int), value3(int)

I need the data to look something like this (the first and second lines are the data, the third line is static text, the position lines are data):

1/1/2009
--------------------------------------------------------------------------
|                              [First line]                              |
--------------------------------------------------------------------------
|                             [Second line]                              |
--------------------------------------------------------------------------
|  Date |       Name            |   Value 1    |   Value 2   |  Value 3  |
==========================================================================
| [Date]|      [Name]           |  [Value 1]   |  [Value 2]  | [Value 3] |
--------------------------------------------------------------------------
| [Date]|      [Name]           |  [Value 1]   |  [Value 2]  | [Value 3] |
--------------------------------------------------------------------------
1/2/2009
--------------------------------------------------------------------------
|                              [First line]                              |
--------------------------------------------------------------------------
|                             [Second line]                              |
--------------------------------------------------------------------------
|  Date |       Name            |   Value 1    |   Value 2   |  Value 3  |
==========================================================================
| [Date]|      [Name]           |  [Value 1]   |  [Value 2]  | [Value 3] |
--------------------------------------------------------------------------
| [Date]|      [Name]           |  [Value 1]   |  [Value 2]  | [Value 3] |
--------------------------------------------------------------------------

, . . . - tinyint.

, : ASP.NET ? DataList? ? /?

EDIT: , , Windows 2000/IIS5, ASP.NET 2.0 3.0 3.5 .

+3
5

, , . , , - .

, , RowBase, , GetRow(); : BannerRow ItemRow RowBase. , .

DataAdapter.

List <RowBase> , BannerRow, ItemRow .

List <RowBase> .Sort, , , BannerRows ItemRows.

, -, runat = "server" id = "maintable", List <RowBase> GetRow RowBase.

BannerRow ItemRow GetRow(), HtmlTableRow, . ItemRow.

, , , .

0

asp:. .

+2

XML, XSLT . GridView .

+1

true .. , .

+1

<asp:Table> .

colspan (), , , .

, 5.

+1

Source: https://habr.com/ru/post/1704157/


All Articles