It's because of ClientInstanceName in your case is static it is always the same for all your controls. In ClientInstanceName you defining the name of variable where client side JS API object will be stored. And because these names are equals for all your user contriols (and browser knows nothing about user controls, only final HTML and JS) you getting the last one after page initialization (client side) phase.
+ similar behaviour with ClientIDMode="Static"
So how to fix:
1. in this part - newWidth = dockPanelContent.clientWidth;
you referring to node directly by ID, obviously if you have several node on page with the same ID it can't work.
I would recommend to search within sender main control to identify element
var dockPanelContent = $('#dockPanelContent', e.GetMainElement()).get(0);
- Create some prefix that should be different for every control on page. Use this prefix to dynamically modify client instances and static IDs within your user control.
Rewrite your script, in you case it can't be static (actually it can but it's a long story), it should be different (because you'll have different IDs and client instance names) for every instance of user control on page.
Description of similar problem: http://www.devexpress.com/Support/Center/p/B141088.aspx