We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Master-Detail doesn''t work with DockingManager. Pls help

Thread ID:





25062 Feb 17,2005 07:45 AM UTC Feb 18,2005 07:03 AM UTC WinForms 2
Tags: GridControl
Frank Lin
Asked On February 17, 2005 07:45 AM UTC

I''m trying to design a master-detail form by adding two GDBGs. The following codes from users guide will work well. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ´fill the dataset with the two tables Me.SqlDataAdapter1.Fill(Me.DataSet11.Customers) Me.SqlDataAdapter2.Fill(Me.DataSet11.Orders) ´add a DataRelation to the dataset Dim dr As DataRelation = New DataRelation("CustomersToOrders", Me.DataSet11.Customers.Columns("CustomerID"), Me.DataSet11.Orders.Columns("CustomerID")) Me.DataSet11.Relations.Add(dr) ´set up the datasources Me.masterGrid.DataSource = Me.DataSet11.Tables("Customers") Me.detailsGrid.DataSource = Me.DataSet11.Tables("Customers") Me.detailsGrid.DataMember = "CustomersToOrders" End Sub However, after I add a dockingManager and enable masterGrid to be dockable, the detailGrid never respond to the row changes in the masterGrid any more.

Administrator [Syncfusion]
Replied On February 17, 2005 09:31 AM UTC

In order for the master-details to work, both grid''s need to be using the same binding context. Normally, the grid takes its binding context from its parent. Try handling the DockedStateChanged event and force the two grids to have teh same BindingContext.
private void dockingManager1_DockStateChanged(object sender, DockStateChangeEventArgs arg)
	if(this.gridDataBoundGrid1.BindingContext == null)
		this.gridDataBoundGrid1.BindingContext = new BindingContext();
	this.gridDataBoundGrid2.BindingContext = this.gridDataBoundGrid1.BindingContext;

Frank Lin
Replied On February 18, 2005 07:03 AM UTC

It works. Thanks Clay.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon