ASP サイトのリストビュー権を取得するのに問題があります。私のデータは次のとおりです。
だから私は統計のリストを含む辞書を持っています:
Dictionary<string, IList<Stats>>
Data example: Key Value
Port1 List<Stats>: - int NumberOfSuspended
| - int NumberOfCompleted
|------ string messagetype
Port2 List<Stats>: -int numberOfSuspendes
| - int numberOfCompleted
|-----string messagetype
クラス「stats」には、いくつかの変数 (messagetype & numberofsuspended) が含まれています。
したがって、次のようなビューリストを作成する必要があります。
<table>
<tr><td>Port1</td></tr>
<tr><td>Messagetype</td><td>numberofSuspended</td>
<tr><td>Port2</td></tr>
<tr><td>Messagetype</td><td>numberofSuspended</td>
.......
</table>
つまり、基本的には、ディクショナリの foreach リストは、統計プロパティを含む行を作成します (ディクショナリのキーは titlerow です)。
したがって、最終結果は次のとおりです。
|----------------------------------------------
| PORT 1
|----------------------------------------------
| MessageType1: | 0/0 | 0/0
|----------------------------------------------
| MessageType2: | 0/0 | 0/0
|----------------------------------------------
|-----------------------------------------------
| PORT 2
|----------------------------------------------
|----------------------------------------------
| MessageType1: | 0/0 | 0/0
|----------------------------------------------
| MessageType2: | 0/0 | 0/0
|----------------------------------------------
リストビューのitemTemplateを手伝ってくれる人はいますか? 辞書を使うのでちょっと難しいかな?DataBinding (Listview.Datasource = Dictionary<..>) を利用します
ありがとうございました