Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
425
Master / Details between two UltraWinGrids
posted

Hi,

   I was trying to use two UltraWinGrids to display a master / detail page for my offline data set.  On my data set, there is a master table and child table with a relationship.  On the master grid, I binded the data set with master table as the data member, and on the detail grid, I binded to the data set with child table as data memer.  However, when I changes my selection in the master grid, the child grid does not change according to my selection.  The child table always shows all the data from the child table.  Is there anything that I'm doing wrong?  Can someone provide some samples?  Thanks!

Parents
No Data
Reply
  • 45049
    posted

    This sounds like an issue with how you've databound the two WinGrid objects.

    Let's assume you have a DataSet called "ds" with two DataTables, "dtParent" and "dtChild", connected with a DataRelation called "Parent_Child".  Let's also assume that your two grids are called "ultraGrid1" for the parent data and "ultraGrid2" for the child data.

    You likely have set up your databinding as follows (in C# code):

    this.ultraGrid1.SetDataBinding(ds, "dtParent"); // sets DataSource, DataMember
    this.ultraGrid2.SetDataBinding(ds, "dtChild");

    If this is true, then the results you've described are expected.

    To get what you're after, you need to use the .NET data binding syntax to bind your second grid such that .NET knows that the two grids need to be synchronized.  You do this by using the parent table's name, and the name of the DataRelation.

    In the above example, the desired syntax for databinding the second grid is:

    this.ultraGrid2.SetDataBinding(ds, "dtParent.Parent_Child");

    With this, the second grid will only show the child rows relevant to the active row in the first grid.

    Please remember that these forums area a peer-to-peer resource to share issues and ideas with other Infragistics users.  If you require official support from Infragistics for further assistance, please submit a support incident to Infragistics Developer Support from this page of our website.

Children