views:

1023

answers:

1

I have 4 Ajax Toolkit cascading dropdowns on my page.

Under certain conditions on load I set the selected values on the first 2. I now want to disable the first 2 dropdowns in these conditions so they still function but the user cant change the selected value. I've tried setting enabled to false on the dropdown box but it seems the Cascading extender overrides this and sets it back to true. I've also tried setting enabled to false on the extender but this causes the dropdown and child dropdowns not to be populated.

Before I start attempting a javascript solution is there another way of doing this?

Thanks

A: 

I achieved this by adding a custom attribute server side to the controls stating if I wanted them disabled, I called this MappedControl, I then used the following Javascript to do the disabling

function Level1Populated() {
    if ($("*[id$='ddl_OrganisationalLevel4Id']").attr("MappedControl")) {
        $("*[id$='ddl_OrganisationalLevel4Id']").disabled = true;
    }
}
function pageLoad(sender, args) {  
    $find("ccd_Level1BID").add_populated(Level1Populated);
}
Gavin Draper