C1DockControl returns items which are not added initially after ItemDockModeCha

Posted by: vinothkumar.r2210 on 4 October 2020, 11:35 pm EST

  • Posted 4 October 2020, 11:35 pm EST


    I have added two custom controls (i.e. DockTabControl derived based on C1DockTabControl) inside C1DockControl. When I am dragging any DockTabControl and docking in C1DockControl it triggers ItemDockModeChanged event. While checking items of C1DockControl it returns 3 items. It returns C1DockTabControl which I have not added initially inside my C1DockControl. Please refer the attached images and source code and please check with ItemDockModeChanged event.

    Kindly do the needful.

    Thanks and Regards,
    Vinoth Kumar Ravi
  • Replied 5 October 2020, 8:52 pm EST

    Hi Vinoth,

    It seems you have created another post for the same query. So, we have replied to your original post https://www.grapecity.com/forums/wpf-edition/customtype-class-changed-a. You're requested to continue the discussion there.
    If however, you meant to demonstrate anything in addition to the above case, please share the XAML code of your Window.

  • Replied 6 October 2020, 3:04 pm EST

    Hi Ruchir,

    Please find the attached source code for the same.

    Thansk and Regards,
    Vinoth Kumar RaviDockControls.zip
  • Marked as Answer

    Replied 8 October 2020, 4:52 pm EST

    Hi Vinoth,

    > While checking items of C1DockControl it returns 3 items.

    This is the design behavior of the C1DockControl as whenever any C1DockTabControl is Undocked/Docked, a new instance of C1DockTabControl is created (for hosting the floating DockTabItems) and added to the C1DockControl's ItemCollection.

    However, In order to allow DockControl to use your custom DockTabControl during this recreation, you should override the CreateDockTabControlOverride method of C1DockControl as follows:

    public class DockControl : C1DockControl
    protected override C1DockTabControl CreateDockTabControlOverride()
    // returning custom dock tab control
    return new DockTabControl();

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels