标签归档:合并

在GRIDVIEW中合并单元格

///   <summary>       ///   合并GridView列中相同的行       ///   </summary>       ///   <param   name=”GridView1″>GridView对象</param>       ///   <param   name=”cellNum”>需要合并的列</param>     …


///   <summary>       ///   合并GridView列中相同的行       ///   </summary>       ///   <param   name="GridView1">GridView对象</param>       ///   <param   name="cellNum">需要合并的列</param>       public static void GroupRows(GridView GridView1, int cellNum)     {         int i = 0, rowSpanNum = 1;         while (i < GridView1.Rows.Count - 1)         {             GridViewRow gvr = GridView1.Rows[i];             for (++i; i < GridView1.Rows.Count; i++)             {                 GridViewRow gvrNext = GridView1.Rows[i];                 if (gvr.Cells[cellNum].Text == gvrNext.Cells[cellNum].Text)                 {                     gvrNext.Cells[cellNum].Visible = false;                     rowSpanNum++;              ...... [阅读全文]