ms-help://MS.VSCC/MS.MSDNVS.2052/Cpqstart/html/cpsmpnetsamples-howtodataadonet.htm#cpsmprelationaldatasample

解决方案 »

  1.   

    datagrid.datasource=
    datagird.bind()
      

  2.   

    我要以超连接形式显示RELATIONAL DATA!
      

  3.   


    ms-help://MS.VSCC/MS.MSDNVS.2052/Vbcon/html/vbconIntroductiontotheDataGridControl.htm
    中图示样
      

  4.   

    给你一个例子吧,如下:(以两个表为例)
     void Form_Load(object sender, System.EventArgs e)
    {
    daYoursTab1.Fill(YoursTabInfo);//YoursTabInfo = new DataSet();
    daYoursTab2.Fill(YoursTabInfo);
    EmpInfo.Relations.Add( "链接文字",
    YoursTab1Info.Tables["Tab1"].Columns["Tab1ID"],
    YoursTab2Info.Tables["Tab2"].Columns["Tab2ID"]);
    dataGrid1.DataSource = YoursTabInfo.Tables["YoursTable"];
    }
    // /////////////////////////////
    void DataGridSelectMouseUp(object obj, System.Windows.Forms.MouseEventArgs mea)
    {
    Point ptMouse = new Point(mea.X, mea.Y);
    DataGrid.HitTestInfo hit = dataGrid1.HitTest(ptMouse);
    if(hit.Type == DataGrid.HitTestType.Cell)
    {
    dataGrid1.CurrentCell = new DataGridCell(hit.Row, hit.Column);
    dataGrid1.Select(hit.Row);
    }
    }