简体   繁体   English

需要有关使用ASP.NET Web窗体显示稍微复杂的表的建议

[英]Need suggestions for displaying somewhat complex table with ASP.NET Web Forms

I don't have much experience with ASP.NET Web Forms and need to generate somewhat complex table. 我对ASP.NET Web窗体没有太多的经验,需要生成一些复杂的表。

I have following classes: 我有以下课程:

public class ServiceTable
{
    ...
    public IList<Service> Services { get; set; }
    public IList<ServiceJob> ServiceJobs { get; set; }
    ...
}

public class Service
{
    ...
    public string ServiceName { get; set; }
    public IList<ServiceJob> ServiceJobs { get; set; }
    ...
}

public class ServiceJob
{
    ...
    public string JobName { get; set; }
    ...
}

And I need to display a column for each Service in ServiceTable , header should be ServiceName . 我需要在ServiceTable为每个Service显示一列,标题应为ServiceName Then I need a row for each ServiceJob that ServiceTable has and first column in each row should be JobName and next ones should be checkboxes which are checked if corresponding service has that ServiceJob . 然后,我需要为ServiceTable拥有的每个ServiceJob行,每行的第一列应为JobName ,下一行应为复选框,检查相应的服务是否具有该ServiceJob
Little mockup: 小样机:

+---------+--------------+--------------+---------------+  
|         | ServiceName1 | ServiceName2 | ServiceName..n|  
+---------+--------------+--------------+---------------+  
| JobName | ckbx         | ckbx         | ckbx          |  
+---------+--------------+--------------+---------------+  

I'm thinking about gridview, but can't seem to figure out how to accomplish that. 我正在考虑gridview,但似乎无法弄清楚如何实现这一点。

I need to use this table to diplay already entered data and to enter new data. 我需要使用此表来显示已经输入的数据并输入新数据。

Looking formward for suggestions! 期待提出建议!

你必须使用嵌套的gridviews来达到...这是人行道

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM