本文介绍了ASP.net分页格与合并后的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用的GridView控件来显示表格数据。我需要合并的细胞中具有相等的值的第一列。此刻我在 preRender 事件code设置 ROWSPAN 属性对我来说,和它的正常工作。

的问题是无法使用的寻呼,因为这些页面将在一个部分,其中第一场是相等的中间分割

欲用于寻呼记录计数计数为每个合并的行,而不是为每个子行

这可能与GridView控件或其他一些jQuery网格?


解决方案

 为(I = PagSize; I< = dt.Rows.Count;我++)
{
    。币种= dt.Rows [我 - 1] [品牌]的ToString();
    如果(ⅰ&下; dt.Rows.Count)
    {
        。NXT = dt.Rows [I] [品牌]的ToString();
        差异= dt.Rows.Count - 我;
        如果(币种!= NXT)
        {
            DctPaging.Add(页次,I);
            页次=页次+ 1;
            I = I + PagSize;
            如果(ⅰ&GT = dt.Rows.Count)
            {
                DctPaging.Add(页次,I);
                打破;
            }
        }
    }
}

点击这里

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.

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;
            }
        }
    }
}

Reference Click Here

这篇关于ASP.net分页格与合并后的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 02:31