ASP.net Grid paging with merged rows(具有合并行的 ASP.net 网格分页)
问题描述
我目前正在使用 GridView 来显示表格数据.我需要合并第一列中具有相同值的单元格.目前我在 PreRender 事件中有代码可以为我设置 RowSpan 属性,它工作正常.
I am currently using GridView to display tabular data. I need to merge cells in the first column that have equal values. At the moment I have code in the PreRender event to set the RowSpan property for me, and it's working fine.
问题是我不能使用分页,因为页面会在第一个字段相等的部分中间拆分.
The problem is I cannot use paging, since the pages will split in the middle of a section where the first field is equal.
我希望分页的记录计数为每个合并的行计数一个,而不是每个子行一个.
I want the record count for paging to count one for each of the merged rows, rather than one for each sub-row.
GridView 或其他一些 jQuery 网格可以做到这一点吗?
Is this possible with GridView or some other jQuery grid?
推荐答案
for (i = PagSize; i <= dt.Rows.Count; i++)
{
Curr = dt.Rows[i - 1]["Brand"].ToString();
if (i < dt.Rows.Count)
{
Nxt = dt.Rows[i]["Brand"].ToString();
diff = dt.Rows.Count - i;
if (Curr != Nxt)
{
DctPaging.Add(PageNum, i);
PageNum = PageNum + 1;
i = i + PagSize;
if (i >= dt.Rows.Count)
{
DctPaging.Add(PageNum, i);
break;
}
}
}
}
参考点击这里
这篇关于具有合并行的 ASP.net 网格分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:具有合并行的 ASP.net 网格分页
基础教程推荐
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 将数据集转换为列表 2022-01-01
- 如果条件可以为空 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 获取C#保存对话框的文件路径 2022-01-01
