简体   繁体   English

无法决定对动态创建的行使用哪个数据控件

[英]Not able to decide which data control to use for dynamically created rows

I am fetching data from database. 我正在从数据库中获取数据。 Initially it will return me root element rows, which can have multiple child elements. 最初,它将返回根元素行,其中可以有多个子元素。 Problem is I am fetching each parent row and then if I select one row, it will return child rows of that with new rows added for same automatically. 问题是我要获取每一行父行,然后如果我选择一行,它将返回该行的子行,并自动为其添加新行。 I am not able to decide between grid view or datalist. 我无法在网格视图或数据列表之间做出选择。 Which will suffice my scenerio or is there better way to do this. 这足以满足我的要求,或者有更好的方法来做到这一点。 The data returned from database is huge, so performance wise I need to get appropriate control. 从数据库返回的数据非常庞大,因此在性能方面我需要获得适当的控制。

Below is an example 下面是一个例子

Parent elements : 父元素:

在此处输入图片说明

Child elements of particular rows , in this example of Current Liabilitiess. 在当前负债示例中,特定行的子元素。 Each row will have different amounts associated with that. 每行将具有与此相关的不同数量。 It can go upto any hierarchy level: 它可以上升到任何层次结构级别:

在此处输入图片说明

As you have already sort out that either datalist or gridview. 正如您已经整理出的数据列表还是gridview。 I suggest that DataList as it is more flexible and powerful and you can utilize javascript to hide and display nested row. 我建议使用DataList,因为它更灵活,功能更强大,您可以利用javascript隐藏和显示嵌套行。

GridView is also powerful control but it that case also you have to do nested gridview. GridView也是强大的控件,但是在这种情况下,您还必须进行嵌套的gridview。 Like when row get clicked you have to display another gridview in that item. 就像单击行时一样,您必须在该项目中显示另一个gridview。

There are many third party control available then do same functionality that you need. 有许多第三方控件可用,然后执行所需的相同功能。

Use a Treeview Control. 使用树视图控件。 Its more flexible. 它更灵活。

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

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