Welcome to the Xceed Community | Help
Community Search  
More Search Options

Exception "Child list for field RelationParentChild cannot be created" in SetDataBinding on DetailGrid

Sort Posts: Previous Next
  •  09-21-2011, 8:30 AM Post no. 31069

    Exception "Child list for field RelationParentChild cannot be created" in SetDataBinding on DetailGrid

    Hello,

     

    I encountered some strange behaviour on the Xceed Gridcontrol for Windows Forms  (v3.9), trying to implement a databound master detail

    grid. I setup and loaded two datatables in a dataset with an additional Parent-Child-Relationship between these two tables added to the

    dataset. The relation has been tested, there is no problem in navigating the parent-child relationship (e.g. by calling DataRow.GetChildRows,

    using this relation).

    When establishing the databinding in the detailgrid, an exception is thrown: "Child list for field RelationParentChild cannot be created"

    The actual code looks like this:

     

    gridControl.BeginInit();

    gridControl.SetDataBinding(dataTableParent, "");

    // additional code to setup grid

     

    DetailGrid detailGrid = new DetailGrid();

    // additional code to setup detail grid

     gridControl.Add(detailGrid);

    detailGrid.SetDataBinding(dataTableChild, relationName); // here exception occurs

     

    I read related postings to this problem, but none seems to address this special issue, as the databinding

    should be complete here.

    Any ideas on this strange behaviour?

     

    Thanks!

     

    Dietmar

     

     

     

     

  •  10-06-2011, 7:56 AM Post no. 31158 in reply to 31069

    Re: Exception "Child list for field RelationParentChild cannot be created" in SetDataBinding on DetailGrid

    Normal 0 false false false EN-CA X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

    Hi Dietmar,

    I would have to see all your code where it concerns binding to the GridControl. You can always refer to the online documentation which describes in full detail how to add the Master/Detail feature to the Grid for .NET. Just by looking at the simple code snippet in your post, it seems as though everything is ok. You can always send us a sample application (you can use the Northwind Database which we provide for you as a DLL
    Xceed.Grid.Samples.SampleData) and we can see what is exactly going on.
    You can send it to support@xceed.com and please make a reference to this post so that we know it is you. If you want to retrace your steps
    instead, you can refer to the information below that I have gathered for you.
     
    http://doc.xceedsoft.com/products/XceedGrid/Building_a_bound_hierarchical_master_detail_grid.html

    You can also create a DataSet with the relation already done for you and
    just bind your DataSet to the DataSource of your DataGridControl instance. An example of this can be found in the MasterDetailGrid sample application.

    C:\Xceed Samples\Xceed Grid for .NET v3.9\CSharp\MasterDetailSimple
     
    If you want to set the relation in code behind, you can do as in the regular MasterDetail sample application which does it for you in the LoadSynchronizedGrid method in the MasterDetail class.

    C:\Xceed Samples\Xceed Grid for .NET v3.9\CSharp\MasterDetail 


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.