Dock position changes when clicked on handle

5 posts, 0 answers
  1. Deepak
    Deepak avatar
    2 posts
    Member since:
    Dec 2011

    Posted 08 Dec 2011 Link to this post

    I am having multiple docks of different size ininside a dockzone in a matrix form. The format of the matrices can be small-small-small, medium-small and large in one row.
    When a small dock (next or previous to medium dock) is clicked on its handle/grip (intention is to just select the dock NOT to drag), it automatically gets repositioned to the last place in dockzone. If I click on dockbody, it works properly.
    I believe this is happening due to client drag/drop events. Can we identify/trap a single click on dock handle?
    attachment is the snapshot of dockzone containing docks.

    Regards,
    Deepak
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 09 Dec 2011 Link to this post

    Hello Deepak,

    If you don't want the ability for the Docks to be dragged until they are selected, perhaps you should set the docks to not be able to be dragged and then on the client-side enable the drag feature (using set_enableDrag) of the dock during the click event you've setup.

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 13 Dec 2011 Link to this post

    Hi Deepak,

    Indeed, when a user clicks on the RadDock titlebar, a drag start is detected, so you can use the method that Kevin suggested in order to disable and enable the dragging of the dock controls according to your needs. Nevertheless, the main problem seems to be that the RadDock controls on your page are not persisting their layout as the position is changed without actually dragging the dock. I would suggest checking if the RadDocks and the RadDockZones are wrapped in a RadDockLayout, which is responsible for their automatic position management. In case you are using the events of the dock layout SaveDockLayout and LoadDockLayout in order to save the dock state in a particular storage medium, please check if the saved data is correct.

    I hope that helps.

    Best wishes,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  5. Deepak
    Deepak avatar
    2 posts
    Member since:
    Dec 2011

    Posted 15 Dec 2011 Link to this post

    Here is the layout I am using:
                        <afs:RadDockLayout runat="server" ID="docklayDisplayGroups">
                            <afs:RadDockZone runat="server" ID="dockzHiddenDisplayGroup" Orientation="Horizontal"
                                CssClass="formLayout threeColumn" Style="height: 0; position: absolute;
                                top: 0; z-index: -1; overflow:hidden;">
                                <afs:RadDock runat="server" ID="dockNewDataItem" DockMode="Docked">
                                    <Commands>
                                        <telerik:DockCloseCommand />
                                    </Commands>
                                    <ContentTemplate>
                                        <asp:PlaceHolder runat="server" ID="plchNewControlMarkup" />
                                        <asp:HiddenField ID="hdnNewDockContentState" runat="server" />
                                        <asp:HiddenField ID="hdnNewDockControlLabelDesc" runat="server" />
                                    </ContentTemplate>
                                </afs:RadDock>
                            </afs:RadDockZone>
                        </afs:RadDockLayout>

    I am not implementing dockrepositioning client events
    I do not want to disable the draging functionality as I need to reposition them inside a doczone. When my intentiona are not dragging, rather selecting the dock, need to raise client click rather drag_start.

    Regards,
    Deepak
  6. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 19 Dec 2011 Link to this post

    Hello Deepak,

    If I understand your scenario correctly, you want to place a RadDock on the last position of the RadDockZone, when the user clicks on the docks title bar. Since this click starts dragging, the RadDock will always be placed on the same position instead at the end of the RadDockZone.

    You can achieve the desired behavior by handling the client events OnClientDragStart and OnClientDragEnd in order to check if the dock is moved by comparing the index and the RadDockZoneID of the dragged RadDock before and after it is moved. If they are equal, which means that the dock control's titlebar was only clicked, you can use the RadDockZone's client method dock(RadDock, index) in order to move the clicked dock control to the last position of the zone.

    I have attached a sample page, demonstrating the described behavior. You can use it as a reference for incorporating the desired feature into your actual project.

    Kind regards,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017