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

3 posts, 1 answers
  1. Loc
    Loc avatar
    2 posts
    Member since:
    Nov 2011

    Posted 04 Nov 2011 Link to this post

    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. Answer
    Slav
    Admin
    Slav avatar
    1355 posts

    Posted 09 Nov 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Loc
    Loc avatar
    2 posts
    Member since:
    Nov 2011

    Posted 09 Nov 2011 Link to this post

    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. 
Back to Top