How to use Accordion with objectdatasource...???

Last post 08-30-2008 1:28 AM by WebEye. 2 replies.

Sort Posts:

  • How to use Accordion with objectdatasource...???

    08-28-2008, 7:37 PM
    • Member
      26 point Member
    • WebEye
    • Member since 11-25-2007, 1:52 PM
    • Posts 27

    Hi,

    I am just trying to bind data to accordion control using objectdatasource.I have an GetDepartments() method in BLL.Which returns all the departments.I just want to show department's title in the header of accordion.I am trying to do it like this....

     .aspx

    ----------

    <div class="sectiontitle">

    Product Categary<br />

    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetDepartments"

    TypeName="BLL.Store.Department">

    </asp:ObjectDataSource>

    </div>

    <div class="productmenulink">

    <cc1:Accordion ID="Accordion1" runat="server" HeaderCssClass="" ContentCssClass=""

    FadeTransitions="true" AutoSize="None" FramesPerSecond="30" TransitionDuration="240"

    SelectedIndex="-1" RequireOpenedPane="false" >

    <Panes>

    <cc1:AccordionPane ID="AccordionPane1" runat="server" >

    <Header>

    asp:Label runat="server" Id="lbHeaderId" Text='<%# Eval("Title") %>'></asp:Label></Header>

    <Content>

    Item 1</br> Item 2</br> Item 3</br> Item 4</br> Item 5</br> Item 6</br> Item 7</br>

    Item 8</br> Item 9</br> Item 10</br> Item 11</br> Item 12

    </Content>

    </cc1:AccordionPane>

     

    .cs

    ------------

    protected void Page_Load(object sender, EventArgs e)

    {

     

    Accordion1.DataSource = ObjectDataSource1;

    Accordion1.DataBind();

    }

    But this is not working.Even accordion is just not visible on the page.I have checked my GetDepartments() method, it is fine and returning proper data.

     

    Thanks

     

    “Do not go where the path may lead, go instead where there is no path and leave a trail.”- Waldo Emerson
  • Re: How to use Accordion with objectdatasource...???

    08-29-2008, 12:51 AM
    • Star
      12,651 point Star
    • docluv
    • Member since 06-29-2002, 11:16 PM
    • Willow Spring NC
    • Posts 2,003
    • ASPInsiders
      TrustedFriends-MVPs
  • Re: How to use Accordion with objectdatasource...???

    08-30-2008, 1:28 AM
    Answer
    • Member
      26 point Member
    • WebEye
    • Member since 11-25-2007, 1:52 PM
    • Posts 27
    Thanks for your answer docluv...Actually my problem was different. I figured it out later. I was trying to bind a generic list of object to accordion, which accordion does not support. So I just convert my generic list of object to a datatable. Now every thing is working fine.
    “Do not go where the path may lead, go instead where there is no path and leave a trail.”- Waldo Emerson
Page 1 of 1 (3 items)