Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
15594 | Jun 23,2004 08:52 AM UTC | Jun 25,2004 09:56 AM UTC | WinForms | 10 |
![]() |
Tags: GridControl |
this.gridDataBoundGrid1.Binder.ResetHierarchyLevels();
to see if that makes a difference.
>this.gridDataBoundGrid1.Binder.ResetHierarchyLevels();
>
>to see if that makes a difference.
private void Form1_Load(object sender, System.EventArgs e)
{
DataTable parentTable = GetParentTable();
DataTable childTable = GetChildTable();
DataSet ds = new DataSet();
ds.Tables.AddRange(new DataTable[]{parentTable, childTable});
DataRelation parentToChild = new DataRelation("ParentToChild", parentTable.Columns["parentID"], childTable.Columns["ParentID"]);
ds.Relations.AddRange(new DataRelation[]{parentToChild});
this.gridDataBoundGrid1.DataSource = parentTable;
this.gridDataBoundGrid1.Binder.AddRelation("ParentToChild");
}
>private void Form1_Load(object sender, System.EventArgs e)
>{
> DataTable parentTable = GetParentTable();
> DataTable childTable = GetChildTable();
> DataSet ds = new DataSet();
> ds.Tables.AddRange(new DataTable[]{parentTable, childTable});
> DataRelation parentToChild = new DataRelation("ParentToChild", parentTable.Columns["parentID"], childTable.Columns["ParentID"]);
> ds.Relations.AddRange(new DataRelation[]{parentToChild});
> this.gridDataBoundGrid1.DataSource = parentTable;
> this.gridDataBoundGrid1.Binder.AddRelation("ParentToChild");
>}
>
private void button2_Click(object sender, System.EventArgs e) { //set child table this.gridDataBoundGrid1.BeginUpdate(); this.gridDataBoundGrid1.DataSource = null; this.gridDataBoundGrid1.DataMember = ""; this.gridDataBoundGrid1.Binder.ResetHierarchyLevels(); this.gridDataBoundGrid1.DataSource = this.childTable; this.gridDataBoundGrid1.EndUpdate(); } private void button1_Click(object sender, System.EventArgs e) {//set parent table this.gridDataBoundGrid1.BeginUpdate(); this.gridDataBoundGrid1.DataSource = null; this.gridDataBoundGrid1.DataMember = ""; this.gridDataBoundGrid1.DataSource = this.parentTable; this.gridDataBoundGrid1.Binder.AddRelation("ParentToChild"); this.gridDataBoundGrid1.EndUpdate(); }
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.