if you can do it with DataList, why do you need DataGrid??? did the user ask you to implement in DataGrid? if yes, did you ask him/her why so?you have to understand how DataGrid works, each DataItem (DataRowView...) generates a row, so unless you change your DataTable (for example, manually create second column and copy the values in row 2/4/6/... to the second column of row 1/3/5 and delete row 2/4/6/...), you can't get what you want

解决方案 »

  1.   

    datagrid模版中套表格<asp:TemplateColumn HeaderText="说明">
      <HeaderStyle ForeColor="White" Width="200px" />
      <ItemTemplate>
        <table cellSpacing="0" cellPadding="0" width="100%" border="0">
          <tr>
            <td><%# DataBinder.Eval(Container.DataItem,"Column11")%></td>
            <td><%# DataBinder.Eval(Container.DataItem,"Column12")%></td>
          </tr>
          <tr>
            <td><%# DataBinder.Eval(Container.DataItem,"Column21")%></td>
    <td><%# DataBinder.Eval(Container.DataItem,"Column22")%></td>
          </tr>
          <tr>
            <td><%# DataBinder.Eval(Container.DataItem,"Column31")%></td>
    <td><%# DataBinder.Eval(Container.DataItem,"Column32")%></td>
          </tr>
        </table>
      </ItemTemplate>
    </asp:TemplateColumn>