检测到具有相同 ID 的记录时数据列表换行
有点难以解释,但我会尝试。 我有一个通过调用存储过程填充的数据列表。 问题是,当检测到具有相同 ID 的行时,我希望它中断并将其添加到第一条记录下,依此类推......
插图 --> 堆栈 [23,45,566,676,787,878,23,23](这些代表记录 ID)
23
23
23
45
等等。
目前,它正在向不同的数据项添加一行,如下所示。
23
23
23
提前致谢
Kinda hard to explain, but i'll try. I have a datalist that is populated by a call to a stored procedure. The thing is, when rows with the same ID is detected i want it to break and add it under the first record and so on....
Illustration -- > Stack [23,45,566,676,787,878,23,23] (these represent record ID's)
23
23
23
45
and so on.
Currently it's adding a row to a different data item as show below.
23
23
23
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种想法是在行数据绑定期间,检查当前值、上一个值和下一个值。 如果当前行和上一行之间存在匹配,则您有一个组,然后检查下一行(来自原始数据源),如果不同,则插入空行。
One idea would be during the row databinding, check the current value, value previous, and next value. If you have a match between the current and previous, you have a group, then check the next row to come (from your original data source) and if it is different, then insert your empty line.