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 网格分页
基础教程推荐
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- WPF 模态进度窗口 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
