分组到是好办,主要绑定问题1.将分组的数据分别存为两个表,然后绑定.
2.返回整个分组数据,然后在控件绑定时控制(itemBound事件中,保存当前行的时间,然后在下次绑定是判断,如果一样则不输出[1999年发布的文件 ],不一样输出).

解决方案 »

  1.   

    用第3个的控件比如DevExpress里面的有个grid 好象能满足LZ的需要,简单配置下就可以完成工作
      

  2.   

    传一个参数来判断啊 select * from 表名 where 发布时间 = "传进来的参数"//参数可为1999,可为2000,可为2003
      

  3.   

    刚写了一个  VS2005 +SQL2005 下的 参考小山的blog写的 
    URL:http://www.cnblogs.com/singlepine/archive/2007/06/01/365964.html
      

  4.   

    .aspx<form id="form1" runat="server">
        <div>
          <asp:DataList runat="server" Id="dlCategories" GridLines="Both" Bordercolor="black" cellpadding="3"
                    cellspacing="0" Headerstyle-BackColor="#DDDDDD" Headerstyle-Forecolor="#777777" Headerstyle-Font-Name="Arial"
                    Headerstyle-Font-Size="14" Headerstyle-Font-Bold="true" Font-Name="Arial" Font-Bold="true"
                    Font-Italic="true" Font-Size="11" ForeColor="Red" RepeatColumns="1" >
                    <HeaderTemplate>
                        时间
                    </HeaderTemplate>
                    <ItemTemplate>
                        时间<%# Eval("addtime") %>
                        <br>
                        <asp:DataList runat="server" Id="ChildDataList" GridLines="horizontal" Bordercolor="black" cellpadding="3" cellspacing="0" Headerstyle-BackColor="#8080C0" Headerstyle-Font-Name="Arial" Headerstyle-Font-Size="8" Font-Name="Arial" Font-Size="8" datasource='<%# Eval("myrelation") %>' >
                            <ItemTemplate>
                              <table >
                                <tr>
                                <td><%#Eval("id") %></td>
                                <td><%#Eval("name") %></td>
                                <td><%#Eval("time")%></td>
                                </tr>
                               </table>
                                
                            </ItemTemplate>
                        </asp:DataList>
                    </ItemTemplate>
                </asp:DataList>      </div>
        </form>
      

  5.   

    .cs
      protected void Page_Load(object sender, EventArgs e)
        {
            BindData();
        }
        void BindData() 
        {
            string conStr = ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString;
            SqlConnection con = new SqlConnection(conStr);
            DataSet ds = new DataSet();
            SqlDataAdapter dpter = new SqlDataAdapter("select distinct addtime   from fileInfo", con);
            dpter.Fill(ds, "fileInfo_time");
            SqlDataAdapter dtper2 = new SqlDataAdapter("select id,name,addtime as time from fileInfo ", con);
            dtper2.Fill(ds, "subItem");
            ds.Relations.Add("myrelation", ds.Tables["fileInfo_time"].Columns["addtime"], ds.Tables["subItem"].Columns["time"]);
            //this.gridview1.datasource = ds.tables[0];
            //this.gridview1.databind();
            this.dlCategories.DataSource = ds.Tables["fileInfo_time"].DefaultView;
            this.dlCategories.DataBind();
            
        }