tags:

views:

370

answers:

2

I'm using the HeaderTemplate and the ContentTemplate of the Accordion control and binding it to a datatable. For some reason it doesn't display any data. If I bind the datatable to a datalist it works as ecpected, is this a known issue or am i doing something completely wrong. I'm binding the accordion control in the code behind if this makes any difference. Here is the code:

<cc1:Accordion ID="databoundaccordion" runat="server" AutoSize="None"  
HeaderCssClass="articleHeader" HeaderSelectedCssClass="articleHeaderSelected" 
ContentCssClass="articleBody" FadeTransitions="true" 
SuppressHeaderPostbacks="true" RequireOpenedPane="true" 
TransitionDuration="250" FramesPerSecond="40">
<HeaderTemplate>
    <%# DataBinder.Eval(Container.DataItem, "name")%>
</HeaderTemplate>
<ContentTemplate>
    <p>Content goes here</p>
    <a href="Articles.aspx">Go</a>
</ContentTemplate>

and in the c# code behind:

databoundaccordion.DataSource = presenter.getDataTable();
databoundaccordion.DataBind();
A: 

I have just built a simple example which works fine.

rather than using Databinder.Eval(Container.Item, "name") I used Eval("name")

this seems to work with the simple example, I will update when I've tested with my working code.

Morgeh
ok so I tried to use my simple example in my working code and it still didn'y. I have since found that if i retrieve the data source from a database using a table adapter then databinding to an accordion works perfectly fine. However what I am trying to do is create a set of dummy table data programatically so I'm starting a new question about that.
Morgeh
A: 

Hi

I am using a Datalist in the AccordionPane and trying to fire DataList_Itemcommand event. But am not able to get postback in Accordion.

SeoFon