Resize splitter using javascript

I have a splitter control within a User control on a page containing two panes with a grid in each and am trying to size the splitter control on load to fit the available space. I have added a hook to the javascript function with OnClientLoaded="sizeSplitter".

The javascript I'm using is:

function sizeSplitter(sender, args) {

var w = browserWidth() - 10;

var h = browserHeight() - 200;

alert('height=' + h + ' width=' + w);

sender.get_element().style.height = h;

sender.get_element().style.width = w;

}

This returns the browser width and height fine and displays them using the alert, but the splitter seems to be stubbornly remaining the same size as defined.

Dobromir

In order to manually size the splitter on the client you need to use RadSplitter's client-side methods set_width() / set_height() / resize(), e.g.:

function sizeSplitter(sender, args)

{

var w = browserWidth() - 10;

var h = browserHeight() - 200;

alert('height=' + h + ' width=' + w);

sender.resize(w, h);

}

You can find more information regarding RadSplitter's Client-Side API in the following help article:RadSplitter Client Object

All the best,
Dobromir
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

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.