【问题标题】:How to span columns using grid view in asp.net如何在 asp.net 中使用网格视图跨越列
【发布时间】:2012-11-06 20:26:15
【问题描述】:

我在 Asp.net 中使用 gridview 在表格中显示数据

我想显示这样的数据 -

Sr.No    ClassStandard    Division    Total
---------------------------------------------
                          A      B
---------------------------------------------
 1.        First         10      20     30
 2.        Second        15      15     30

如果我直接附加源,那么数据是这样的-

  ClassStandard   A       B     Total
  ------------------------------------------
   First         10      20     30
   Second        15      15     30

代码如下:

if (!IsPostBack)
    {
        try
        {
            IApplicationContext ctx = ContextRegistry.GetContext();
            IServices reg = (IServices)ctx.GetObject("Services");

            DataSet ds = reg.getInstituteStatusByDistrict();
            int Count = ds.Tables[0].Rows.Count;
            gridviewdistrictReport.DataSource = ds;
            gridviewdistrictReport.DataBind();
        }
    }

注意:我使用 Spring .net 进行数据库连接

在 Aspx 文件中

 <asp:GridView ID="gridviewdistrictReport" runat="server">

我应该如何显示上面一行,划分跨越两列.. 请帮帮我..

【问题讨论】:

  • 来源是什么,如何绑定数据?你在使用asp:GrivdView 模板吗?
  • @BrandonWilson 嘿,请看看我再次编辑了这个问题

标签: asp.net gridview


【解决方案1】:

这些链接应该可以帮助您向 gridview 添加多个标题

Example 1

Example 2

【讨论】:

    猜你喜欢
    • 2018-04-29
    • 1970-01-01
    • 2019-10-27
    • 2017-08-24
    • 1970-01-01
    • 2020-04-15
    相关资源
    最近更新 更多