||===||===||          ||===||===||
||  A  ||  B  ||          ||     ||  B  ||
||===||===||    -->   ||   A  ||===||
||  A  ||  A  ||          ||            ||
||===||===||          ||=======||

解决方案 »

  1.   

    Web里还有可能,WinForm看来只有自己建立组件实现这种功能了
      

  2.   

    我曾经用table画,因为不知道datagrid可不可以。
      

  3.   

    没有这种合并的,Excel和Word都做不到,最多也就是隐藏掉一些单元格的边框,看起来是“合并”而已。
      

  4.   

    按我的理解,是把Datagrid中相邻几个单元当中内容相同的数据显示为一个Shell数据,从视觉上看起来用一个数据表示多个,是否是这样?如果如此,那有点图结构解析的意思
      

  5.   

    webfrom里面是没有问题的,winfrom没有做过
    ^_^
      

  6.   

    其实你根本不用找,一般表格控件中的合并功能,最终出来的单元格仍然是矩形的,不可能做到这种不规格的单元格。我做表格控件有一段时间了,也试用过很多控件。你可以试一试我的FlexCell表格控件(.NET版本),处理合并单元格还是比较方便的,可以模拟出你所需要的效果,但缺点是不能够自动合并内容相同的单元格(需要自己编程处理)。1、先下载http://www.grid2000.com/cn/download/FlexCell.NET.zip并安装。2、然后新建一个C#项目,添加一个FlexCell.Grid控件到Form中去,编写如下代码:
       private void Form1_Load(object sender, System.EventArgs e)
       {
         grid1.GridLiness = true;     grid1.Cell(1,1).Text = "A";
         grid1.Cell(1,2).Text = "B";     grid1.Range(1,1,2,1).Merge();
         grid1.Cell(1,1).BackColor = Color.White;
        
         FlexCell.Range range = grid1.Range(1,1,2,2);
         range.set_Borders(FlexCell.Grid.EdgeEnum.Left, FlexCell.Grid.LineStyleEnum.Thin);
         range.set_Borders(FlexCell.Grid.EdgeEnum.Right, FlexCell.Grid.LineStyleEnum.Thin);
         range.set_Borders(FlexCell.Grid.EdgeEnum.Top, FlexCell.Grid.LineStyleEnum.Thin);
         range.set_Borders(FlexCell.Grid.EdgeEnum.Bottom, FlexCell.Grid.LineStyleEnum.Thin);     FlexCell.Cell cell = grid1.Cell(1,2);
         cell.set_Border(FlexCell.Grid.EdgeEnum.Left, FlexCell.Grid.LineStyleEnum.Thin);
         cell.set_Border(FlexCell.Grid.EdgeEnum.Right, FlexCell.Grid.LineStyleEnum.Thin);
         cell.set_Border(FlexCell.Grid.EdgeEnum.Top, FlexCell.Grid.LineStyleEnum.Thin);
         cell.set_Border(FlexCell.Grid.EdgeEnum.Bottom, FlexCell.Grid.LineStyleEnum.Thin);
       }
      

  7.   

    To junwhj(温华军):对于自己写控件的话这种功能也很容易做到,但问题是我从来没有见过有这种需求。
      

  8.   

    To winfarsoft(切变线):我倒不是说做不到,要做这样一个功能的确没有什么困难,但这种应用很少,很少有人愿意专门来做这种功能而已。
      

  9.   

    junwhj(http://www.grid2000.com/cn) 你给的例子是个假的嘛,就是把边界画了一下,不过还是很谢谢,至少给了我一种思路。