zoukankan      html  css  js  c++  java
  • GridView跨行

            string logo = "";
            int i = 0;
            int j = 0;
            protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
            {
                //if(e.Row.RowType==DataControlRowType.Header)
                //{
                //    e.Row.Cells[1].ColumnSpan = 2;
                //    e.Row.Cells[2].Visible = false;
                //    return;
                //}
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    if (i == 0)
                    {
                        logo = e.Row.Cells[1].Text;
                        i++;
                    }
                    else
                    {
                        if (logo == e.Row.Cells[1].Text)//如果这一行与上一行的相等
                        {
                            j++;
                        }
                        else
                        {
                            this.GridView1.Rows[i - 1 - j].Cells[1].RowSpan = j + 1;
                            for (int x = j; x > 0; x--)
                            {
                                this.GridView1.Rows[i - x].Cells[1].Visible = false;
                            }

                            j = 0;
                            logo = e.Row.Cells[1].Text;
                        }
                        i++;
                    }           

                }
                if (e.Row.RowType == DataControlRowType.Footer)
                {
                    this.GridView1.Rows[i - 1 - j].Cells[1].RowSpan = j + 1;
                    for (int x = j; x > 0; x--)
                    {
                        this.GridView1.Rows[i - x].Cells[1].Visible = false;
                    }

                    j = 0;
                    logo = e.Row.Cells[1].Text;
                }
            }

  • 相关阅读:
    [转载-声网]18个实时音视频开发中会用到开源项目
    linux shell命令之wc/split及特殊字符
    RTP推流及验证
    Ubuntu18.04提示wifi无法连接
    ubuntu上Android开发环境及依赖项
    HLS playlist典型示例
    ffmpeg-hls实现分析
    AOSP中的HLS协议解析
    使用ffmpeg搭建HLS直播系统
    流媒体之HLS——综述(二)
  • 原文地址:https://www.cnblogs.com/yidianfeng/p/1405490.html
Copyright © 2011-2022 走看看