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 网格分页


基础教程推荐
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01