有什么 asp.net 的表格控件 能实现主从 数据表示的???????????? 急!!!!
就是每一行都可以在下面展开一个详细的表格的控件。
我用vs2003,最好是免费的控件

解决方案 »

  1.   

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspn-hierdatabinding.asp
      

  2.   

    aspdotnet2005(红枫(想找兼职))  可以给一个例子吗?? 谢谢
      

  3.   

    要写好多代码,我手头上没有现成的例子,
    大概思路就是
    DataList两层嵌套,
    外层的DataList有个显示|隐藏的button.
    内层的DataList外面加个DIV,并设为"不可见",在外层的应该有个ID字段,然后外层的绑定结束后事件内DataList childDataList = (DataList)e.FindControl("DataList2");
    然后对childDataList根据外层的ID进行数据绑定.在html用javascript处理外层的button.click事件,将DIV显示|隐藏就可以了
      

  4.   

    用datagrid1
    建立一模板列
    里面再放一datagrid2
    然后在datagrid1的绑定事件中去绑定datagrid2
      

  5.   

    http://blog.csdn.net/net_lover/archive/2004/06/27/27695.aspx
      

  6.   

    正在学习《asp.net技术内幕》,第10章和第11章都有这样的例子,给你一个第10章的,其它的自己看书吧。(书上是VB.NET的,我改成C#的了,总体上变动不大,不难理解)。
    这个是用repeater控件做的,用datalist用datagrid基本上都差不多,弄懂了一个,其它的都可以懂了。
    <%@ import namespace="System.Data.SqlClient"%><script runat=server language=c#>void Page_Load()
    {
    if(!IsPostBack)
    {
    SqlConnection conNorthwind;
    SqlCommand cmdSelect;
    SqlDataReader dtrCategories;conNorthwind = new SqlConnection("server=localhost;uid=sa;pwd=xtwfkbgy;database=Northwind");
    cmdSelect = new SqlCommand("Select CategoryID,CategoryName from Categories",conNorthwind);
    conNorthwind.Open();
    dtrCategories = cmdSelect.ExecuteReader();
    dropCategories.DataSource = dtrCategories;
    dropCategories.DataTextField = "CategoryName";
    dropCategories.DataValueField = "CategoryID";
    dropCategories.DataBind();dropCategories.Items.Insert(0,new ListItem("none selected","-1"));dtrCategories.Close();
    conNorthwind.Close();
    }
    }void BindProducts( int intCatID )
    {
    SqlConnection conNorthwind;
    SqlCommand cmdSelect;
    string strSelect;
    SqlDataReader dtrProducts;conNorthwind = new SqlConnection("server=localhost;uid=sa;pwd=xtwfkbgy;database=northwind");
    conNorthwind.Open();strSelect = "select ProductName,UnitPrice from Products where CategoryID=@catID";
    cmdSelect = new SqlCommand(strSelect,conNorthwind);
    cmdSelect.Parameters.Add("@catID",intCatID);
    dtrProducts = cmdSelect.ExecuteReader();rptProducts.DataSource = dtrProducts;
    rptProducts.DataBind();dtrProducts.Close();
    conNorthwind.Close();
    }void dropCategories_SelectedIndexChanged(object s,EventArgs e)
    {
    int intCatID;intCatID = int.Parse(dropCategories.SelectedItem.Value);
    if (intCatID != -1 )
    {
    BindProducts( intCatID );
    }
    }</script><html>
    <head><title>MasterDetail.aspx</title></head>
    <body>
    <form runat=server><b>Select Category:</b>
    <asp:DropDownList
    ID="dropCategories"
    AutoPostBack="True"
    OnSelectedIndexChanged="dropCategories_SelectedIndexChanged"
    runat=server/><p><asp:Repeater
    ID="rptProducts"
    EnableViewState = "False"
    runat=server><ItemTemplate>
    <li><%#DataBinder.Eval(Container.DataItem, "ProductName")%>-
    <%#string.Format("{0:c}",DataBinder.Eval(Container.DataItem, "UnitPrice"))%>
    </ItemTemplate></asp:Repeater></form>
    </body>
    </html>