This is a migrated thread and some comments may be shown as answers.

Dock position changes when clicked on handle

4 Answers 146 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Deepak
Top achievements
Rank 1
Deepak asked on 09 Dec 2011, 04:52 AM
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

4 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 09 Dec 2011, 02:46 PM
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.
0
Slav
Telerik team
answered on 13 Dec 2011, 01:00 PM
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
0
Deepak
Top achievements
Rank 1
answered on 15 Dec 2011, 09:08 AM
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
0
Slav
Telerik team
answered on 19 Dec 2011, 04:34 PM
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
Tags
Dock
Asked by
Deepak
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Slav
Telerik team
Deepak
Top achievements
Rank 1
Share this question
or