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

Moving Dock to different Zone, hide Radchart and show image.

2 Answers 77 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Loc
Top achievements
Rank 1
Loc asked on 04 Nov 2011, 03:38 PM
Dear Telerik,

Currently I have 4 different RadDockZone each with a RadDock in it. On the bottom of my page I have a RadRotator with 10 RadDockZone each with a RadDock too. Inside each RadDock I have the RadChart to display the chart from my SQL database. Currently I'm using these code to drag and exchange RadDock between zones, and it's working great.

<script type="text/javascript">


    // Javascript for swapping between DockZones
    var initialZone;
    var initialIndex;
    function OnDragStart(dock, args) 
    {
        initialIndex = dock.get_index();
        initialZone = dock.get_dockZone();
    }


    function OnClientDockPositionChanged(dock, args) 
    {
        var currentZone = dock.get_dockZone();
        var dockToBeDocked = currentZone.get_docks()[dock.get_index() + 1];
        if (dockToBeDocked != null && initialZone != null && currentZone != initialZone) 
        {
            initialZone.dock(dockToBeDocked, initialIndex);
        }
    }

</script>

I would like that whenever I drag a RadDock into the rotator, the dock would display an Image instead of the RadChart's graph. Each of the raddock should has its own image.The initial RadDock in the Rotator on page load only display the image too. Is this something possible to do using Javascript, or I have to do with code behind and autopostback? 

I've been trying to figure out without success. Please help me on this problem.

Thank you,
Loc Huynh

2 Answers, 1 is accepted

Sort by
0
Accepted
Slav
Telerik team
answered on 09 Nov 2011, 08:38 AM
Hello Loc,

You can achieve the desired scenario by placing an ASP Image control with the main content of every RadDock on your page. When a dock control is moved inside and outside the RadRotator, you can use the OnClientDockPositionChanged event handler in order to check the control's position and according to it to show/hide the main content or the image. You can find attached a sample project, implementing this solution. Please use it as a reference to incorporate this feature into your actual project.

I noticed that the presented scenario is the same as the one, reported in another support ticket. For future use of our support system, please use a separate ticket for every problem. This will lead to easier to follow conversation and we'll be able to provide assistance much faster. I would suggest continuing the discussion in the initial support ticket on the matter. 

All the best,
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
Loc
Top achievements
Rank 1
answered on 09 Nov 2011, 03:04 PM
Thank you, Telerik team, for your great support on my issue. The code works great! I posted this topic a couple hours before I opened a Support Ticket. I forgot to reply to this topic after I've got my answer. I apologize for that. 
Tags
Dock
Asked by
Loc
Top achievements
Rank 1
Answers by
Slav
Telerik team
Loc
Top achievements
Rank 1
Share this question
or