CreateChildElements() called during construction

2 posts, 0 answers
  1. Tino
    Tino avatar
    86 posts
    Member since:
    Jul 2017

    Posted 25 Sep 2017 Link to this post

    I'm wondering why my RadDiagramShape's CreateChildElements() is called before it is constructed? This is calling a virtual method from constructor, and stops me from using a model object I pass into my constructor, in my overridden CreateChildElements().

    Here's the stack trace

    TestDiagram.exe!TestDiagram.UcDiagramDropdownDiagramShape.CreateChildElements() Line 69C# Telerik.WinControls.dll!Telerik.WinControls.RadElement.CallCreateChildElements()Unknown
    >TestDiagram.exe!TestDiagram.UcDiagramShape.UcDiagramShape(TestDiagram.DataModelItem item) Line 14C#
     TestDiagram.exe!TestDiagram.UcDiagramDropdownDiagramShape.UcDiagramDropdownDiagramShape(TestDiagram.DataModelItem item) Line 39C#
     TestDiagram.exe!TestDiagram.RadForm1.RadForm1() Line 16C#



  2. Dimitar
    Dimitar avatar
    2984 posts

    Posted 26 Sep 2017 Link to this post

    Hi Tino,

    Yes, this is how the element structure is created and the method is called before the constructor. This method is used for early initialization. This does not prevent you to use your model. In your case, you can create the elements in the CreateChildElements method and then update them in the form's constructor where the model is available.

    Should you have any other questions do not hesitate to ask.

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top