主要在    RowDataBound里处理

    protected void grv_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            switch (e.Row.RowType)
            {
                case DataControlRowType.DataRow:
                case DataControlRowType.Separator:
                    if (grv.Rows.Count == 0)
                        return;
                    if (e.Row.RowIndex % 3 != 0 && e.Row.RowIndex != 0)
                    {
                        int index = (int)(Math.Floor((double)e.Row.RowIndex / (double)3));
                        index = index * 3;
                        for (int i = 0; i < e.Row.Cells.Count; i++)
                            grv.Rows[index].Cells.AddAt(grv.Rows[index].Cells.Count,e.Row.Cells[i]);
                    }
                    break;
            }
        }

相关文章:

  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-11-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-07-09
  • 2021-10-07
  • 2021-08-17
  • 2022-12-23
相关资源
相似解决方案