Ive managed to update my site to AJAX beta and ive got everything up and running again except for dynamic extenders! Please can anyone help, this driving me nuts!!!
Im trying to create a dynamic list of news feeds, organised by category. Where each category has its own collapsible extender.
In ATLAS i could just do this:
<asp:RepeaterID="RepeaterNewsCategorys"runat="server"DataSourceID="SqlAllNewsSourceCategorys">
<ItemTemplate>
<trclass="ItemTitle">
<tdalign="left">
<b><asp:LabelID="lblNewsCategory"runat="server"><%#Eval("Name")%></asp:Label></b>
</td>
<tdalign="right">
<asp:ImageID="imgNewsCategory"runat="server"/>
</td>
</tr>
<tr>
<tdcolspan="2">
<asp:PanelID="PanelNewsCategory"runat="server">
<asp:CheckBoxListID="chkNewsCategoryFeeds"runat="server"DataTextField="Name"DataValueField="ID"OnDataBound="chkNewsFeeds_DataBound"OnSelectedIndexChanged="chkNewsFeeds_SelectedIndexChanged"></asp:CheckBoxList>
</asp:Panel>
<AtlasControl:CollapsiblePanelExtenderID="CollapsibleNewsCategory"runat="Server">
<AtlasControl:CollapsiblePanelPropertiesTargetControlID="PanelNewsCategory"ExpandControlID="imgNewsCategory"CollapseControlID="imgNewsCategory"Collapsed="True"TextLabelID="lblNewsCategory"
ImageControlID="imgNewsCategory"ExpandedImage="../Images/Icons/Collapse.jpg"CollapsedImage="../Images/Icons/Expand.jpg"/>
</AtlasControl:CollapsiblePanelExtender>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
Nice and easy and everything worked fine. Now after updating to AJAX beta, none of the collapsible extenders are rendered and none of the images are loaded.
I read another post about dynamic extenders, and tried to create the extenders in the repeaters ItemDataBound.
<asp:RepeaterID="RepeaterNewsCategorys"runat="server"DataSourceID="SqlAllNewsSourceCategorys">
<ItemTemplate>
<trclass="ItemTitle">
<tdalign="left">
<b><asp:LabelID="lblNewsCategory"runat="server"><%#Eval("Name")%></asp:Label></b>
</td>
<tdalign="right">
<asp:ImageID="imgNewsCategory"runat="server"/>
</td>
</tr>
<tr>
<tdcolspan="2">
<asp:PanelID="PanelNewsCategory"runat="server">
<asp:CheckBoxListID="chkNewsCategoryFeeds"runat="server"DataTextField="Name"DataValueField="ID"OnDataBound="chkNewsFeeds_DataBound"OnSelectedIndexChanged="chkNewsFeeds_SelectedIndexChanged"></asp:CheckBoxList>
</asp:Panel>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
Code Behind:ProtectedSub RepeaterNewsCategorys_ItemDataBound(ByVal senderAsObject,ByVal eAs System.Web.UI.WebControls.RepeaterItemEventArgs)Handles RepeaterNewsCategorys.ItemDataBound
'Find Controls
Dim holdExpandLabelAs Label
Dim holdExpandImageAs Image
Dim holdExpandPanelAs Panel
Dim holdExpandExtenderAs CollapsiblePanelExtender
holdExpandLabel =CType(e.Item.FindControl("lblNewsCategory"), Label)
holdExpandImage =CType(e.Item.FindControl("imgNewsCategory"), Image)
holdExpandPanel =CType(e.Item.FindControl("PanelNewsCategory"), Panel)
'Create CollapsiblePanelExtender object
holdExpandExtender =New CollapsiblePanelExtender()
'Set properties of CollapsiblePanelExtender
holdExpandExtender.ID ="cpe" & holdExpandPanel.ID
holdExpandExtender.TargetControlID = holdExpandPanel.ID
holdExpandExtender.CollapseControlID = holdExpandImage.ID
holdExpandExtender.ExpandControlID = holdExpandImage.ID
holdExpandExtender.ImageControlID = holdExpandImage.ID
holdExpandExtender.CollapsedImage ="../Images/Icons/Expand.jpg"
holdExpandExtender.ExpandedImage ="../Images/Icons/Collapse.jpg"
holdExpandExtender.Collapsed =True
'Add CollapsiblePanelExtender
e.Item.Controls.Add(holdExpandExtender)
But still nothing. Please can anyone help, ive run out of ideas and im tempted to go back to ATLAS at this point!
Please see the "Known Issue" post at the top of this forum. It addresses this issue.
No comments:
Post a Comment