你查一下DataRelation就明白了。

解决方案 »

  1.   

    ms-help://MS.MSDNQTR.2003FEB.2052/vbcon/html/vbconintroductiontothedatagridcontrol.htm
      

  2.   

    我在msdn上看到过类似的文章,你找找看
      

  3.   

    是asp.net 2.0 (whidbey)的:
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx?pull=/library/en-us/dnvs05/html/grddetview.asp
      

  4.   

    System.Data.DataColumn parentCol;
    System.Data.DataColumn childCol; DataColumn[] wldwpk = new DataColumn[1];
    DataColumn[] ryzdpk = new DataColumn[1];
    DataColumn[] wllbpk = new DataColumn[1];
    wldwpk[0] = this.myds.Tables["wldw"].Columns["zwwldw_dwbh"];
    ryzdpk[0] = this.myds.Tables["ryzd"].Columns["xsryzd_rybh"];
    wllbpk[0] = this.myds.Tables["wllb"].Columns["lswllb_lbbh"];
    this.myds.Tables["wldw"].PrimaryKey = wldwpk;
    this.myds.Tables["ryzd"].PrimaryKey = ryzdpk;
    this.myds.Tables["wllb"].PrimaryKey = wllbpk;
    childCol = this.myds.Tables["clftp"].Columns["clftp_dwbh"];
    parentCol = this.myds.Tables["wldw"].Columns["zwwldw_dwbh"];
    try
    {
    DataRelation relCustOrder;
    relCustOrder = new DataRelation("CfltpAndWldw", parentCol, childCol);
    this.myds.Relations.Add(relCustOrder);
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message);
    }
      

  5.   

    用两个数据网格分别绑定父表(customers)和子表(orders)
    当父表移动一行时,子表显示对应的详细资料
      

  6.   

    用两个数据网格分别绑定父表(customers)和子表(orders)
    当父表移动一行时,子表显示对应的详细资料