简体   繁体   English

带控件的嵌套中继器

[英]Nested repeater with controls

I need to create a user interface that resembles the following: 我需要创建一个类似于以下内容的用户界面:

cat 1                              Add Category                   Add Point
     cat 1a                        Add Category                   Add Point
          point
     cat 1b                        Add Category                   Add Point
          point
          point
     cat 1c                        Add Category                   Add Point
          cat 1c1                  Add Category                   Add Point
          cat 1c2                  Add Category                   Add Point
               point

I was thinking about using a repeater with nested repeaters but I am confused on how to go about this. 我当时在考虑将嵌套中继器与嵌套中继器一起使用,但是我对此却感到困惑。 Also within the repeater when the "Add category" or "Add Point" are clicked I need to show an data entry field with a button within the repeater if possible. 同样在转发器中,单击“添加类别”或“添加点”时,如果可能,我需要在转发器中显示带有按钮的数据输入字段。 is a repeater even a good control to use? 中继器甚至是很好的控件吗?

Copied from the comments in the question: I think a custom user control would be ideal here. 从问题的评论中复制:我认为自定义用户控件在这里非常理想。 The user control would nest children items of itself or a set of 'points'. 用户控件将嵌套其本身或一组“点”的子项。 Also, it would support an 'Add Category' or 'Add point' button. 而且,它将支持“添加类别”或“添加点”按钮。 You could keep values such as degree of nesting in the ControlState and can use it to pad the left-most label with respect to the containing control. 您可以在ControlState中保留诸如嵌套度之类的值,并可以使用它来填充相对于包含控件的最左侧标签。

You can check this link to see how to add a user control. 您可以检查此链接以了解如何添加用户控件。 You will optionally also have to do some additional work to maintain the depth of the control using the Control State. 您还可以选择还必须执行一些其他工作,以使用“控件状态”维护控件的深度。

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

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