public void GroupRows(GridView p_GridView, int[] p_ColumnsIndex)
    {
        int _Count = p_GridView.Rows.Count;
        string[] _TempText = new string[p_ColumnsIndex.Length];
        int[] _RowIndex = new int[p_ColumnsIndex.Length];
        for (int i = 0; i != _Count; i++)
        {
            string _CellText = "";
            for (int z = 0; z != p_ColumnsIndex.Length; z++)
            {
                _CellText += p_GridView.Rows[i].Cells[p_ColumnsIndex[z]].Text;
                if (_TempText[z] == _CellText)
                {
                    p_GridView.Rows[i].Cells[p_ColumnsIndex[z]].Visible = false;
                    p_GridView.Rows[_RowIndex[z]].Cells[p_ColumnsIndex[z]].RowSpan++;
                }
                else
                {
                    _RowIndex[z] = i;
                    _TempText[z] = _CellText;
                    p_GridView.Rows[_RowIndex[z]].Cells[p_ColumnsIndex[z]].RowSpan = 1;
                }
            }
        }

相关文章:

  • 2021-09-24
  • 2021-12-12
  • 2021-12-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-15
  • 2021-08-11
  • 2021-11-17
相关资源
相似解决方案