Move TOC Nodes/ Layers (Up, Down)

By Zach Dwight, GIS Programmer, Yakima, WA

Download the script.

Code Summary
move-_toc_nodes_14892.jpgVERY simple code snippet that allows you to create four buttons that move nodes (server or layer) up or down one index within the TOC control of a web application. I created four button events:

-Move Server Node Up
-Move Server Node Down
-Move Layer Node UP
-Move Layer Node Down

Simple? Simpler than it looks even. Modify it and spice it up with some graphics. In my case, I use the checked property to identify the node that should be moved. Pic included and error handling.


3 Responses to Move TOC Nodes/ Layers (Up, Down)

  1. Zach Dwight says:

    I recently updated the script so that the layers will move and update the toc and map to match the changes made using a callback.

  2. Jack Daniels says:

    Hi Zach,

    I had an attempt in trying to get your sample to work, however, at run time after I’ve clicked the Up button, the following line falls over:

    ‘Grab selected layer index stored in hidden field
    Dim field As HiddenField = info.Toolbar.FindControl(“Layer”)

    I am uncertain whether your download contains all the necessary controls/components to get the sample to work. Would you be able to submit/post a sample webapp so we can see the whole picture of how your tools work?

    Thanks for the original post and your assistance.



  3. Amaya Mateos says:

    i have the same problem, could you help me please?

%d bloggers like this: