how to View Relational Data in a DataGrid? ms-help://MS.VSCC/MS.MSDNVS.2052/Cpqstart/html/cpsmpnetsamples-howtodataadonet.htm#cpsmprelationaldatasample 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 datagrid.datasource=datagird.bind() 我要以超连接形式显示RELATIONAL DATA! 如ms-help://MS.VSCC/MS.MSDNVS.2052/Vbcon/html/vbconIntroductiontotheDataGridControl.htm中图示样 给你一个例子吧,如下:(以两个表为例) 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); }} reportviewer部署 C# 如何通过程序判断某文件夹下是否添加了新文件,程序返回该文件的名称信息,文件大小,文件引用等。 c# 中怎样判断鼠标左键是否被按下 textbox怎么用代码换行·· base的级别 请教:如何在派生类中完全禁用基类的函数? 关于安装MSDN Win下如何从服务器下载文件?不通过webservice 请教WEB上使用MS的TreeView控件出现的几个问题/疑问 如何用VC#.net建立控件数组? 菜鸟问题!!帮忙! 300分求C#之好书!(数据库版)
datagird.bind()
ms-help://MS.VSCC/MS.MSDNVS.2052/Vbcon/html/vbconIntroductiontotheDataGridControl.htm
中图示样
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);
}
}