Resizing a DockPanel to DockZone height and width-Collection of common programming errors

I am trying to resize a dynamic dock panel to the size of the dock zone in which it’s contained in javascript(client-side) at runtime. I am using the Dev Express DockZone and DockPanel. My JScript looks like this:

function setDockPanelFill() {
    var dockPanel = ASPxClientControl.GetControlCollection().GetByName('dockPanel1');
    var dockZone = document.getElementById('zone1');
    dockPanel.SetHeight = dockZone.offsetHeight;
    dockPanel.SetWidth = dockZone.offsetWidth;
}

Any ideas on why this won’t work?