当前位置:编程学习 > C#/ASP.NET >>

怎样处理DataTable空白数据

用XmlDocument读取XML文件,已经填充到DataTable.但是绑定到GridView显示时有空白行问题
如下:

<table style="width: 354px; height: 158px">
          <tr>
              <td style="width: 100px">
                  标题一</td>
              <td style="width: 100px">
                  标题二</td>
              <td style="width: 100px">
                  标题三</td>
              <td style="width: 100px">
                  标题四</td>
          </tr>
          <tr>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
                  有数据</td>
              <td style="width: 100px">
              </td>
          </tr>
          <tr>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
              </td>
              <td style="width: 100px">
                  有数据</td>
          </tr>
      </table>

哪位前辈能告诉我怎样才能处理这个空白数据,我用过DataView,但是只能处理一列.循环DataTable的DataColumn再提取列元素,使用Select()方法过滤也不行 --------------------编程问答-------------------- 我以为写HTML代码能显示出表格示例,没想到是一堆代码~~~~~~~~~~~~~ --------------------编程问答-------------------- 没搞清楚什么问题,你上面的空白数据可以合并单元格嘛。 --------------------编程问答-------------------- 先处理DataTable.再绑定到GridView --------------------编程问答-------------------- 从XPath下手
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,