sburke_msft: Caveat:This doesn't work for templated controls that make changes to their tree, such as a GridView with an EditItemTemplate in it. If you have that scenario, unfortunately, you'll need to wait for the next release of ASP.NET AJAX Beta 1 to enable it.
As a newb I'm not sure if my situation is caught by your caveat... could you confirm this for me?
I have a datalist which contains a collapsible panel and I can work around the problem by calling databind on the datalist. This results in the collapsible panels working correctly. However within each datalist iteration I have another nested datalist. This nested datalist generates another collapsible panel for each iteration. Basically I have a list of rulesets, each of which are expandable, and each rule set is comprised of rules, each of which are expandable.
Using this code...
protected void Page_Load(object sender, EventArgs e)
{
this.RulesetDataList.DataBind();
}
...the outer datalist is bound and the outer layer of the collapsible panels work ok but the inner ones do not. So I added this code...
protected void RulesetDataList_ItemDataBound(object sender, DataListItemEventArgs e)
{
if((e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Item))
{
DataList RuleDataList = (DataList)e.Item.FindControl("RuleDataList");
if(RuleDataList != null)
{
RuleDataList.DataBind();
}
}
} ...to bind the inner datalists and thereby enable the inner collapsible panels. However, while the code that does the databinding operation on the inner data lists works fine (the control is found and the databind method runs without blowing up) the end result is that the following error message is generated...
"Microsoft JScript runtime error: Sys.ArgumentException: Value must not be null for Controls and Behaviors. Parameter name: element"
...on this line...
Sys.Application.add_init(function() {
$create(AjaxControlToolkit.CollaspablePanelBehavior, {"ClientStateFieldID":"rule_CollapsiblePanelExtender_ClientState","CollapseControlID":"rule_Header","Collapsed":true,"CollapsedImage":"images/expand.jpg","ExpandControlID":"rule_Header","ExpandedImage":"images/collapse.jpg","id":"rule_CollapsiblePanelExtender","ImageControlID":"rule_ToggleImage","SuppressPostBack":true}, null, null, $get('rule_Content'));
});
Does that give enough information to determine if I'm caught by your caveat or not?
Thanks,
Mark