Accordion panes databinding

Last post 08-06-2007 1:23 PM by stadium. 3 replies.

Sort Posts:

  • Accordion panes databinding

    07-31-2007, 4:21 PM
    • Member
      point Member
    • stadium
    • Member since 07-31-2007, 4:12 PM
    • Posts 3

    I have an Accordion with five different AccordionPanes that I want to databind to five different datasets from my business logic layer, i can bind using a sqldatasource, but that is not what i want.any body with a suggested method?

  • Re: Accordion panes databinding

    08-06-2007, 4:26 AM

     Hi,

    You may try this approach, programmatically fill five DataSet objects in Page_Load, and set it as the DataSource for different controls.

    Then, call DataBind on those controls.

    Hope I get you correctly.
     

  • Re: Accordion panes databinding

    08-06-2007, 10:45 AM
    • Member
      point Member
    • stadium
    • Member since 07-31-2007, 4:12 PM
    • Posts 3

    next

  • Re: Accordion panes databinding

    08-06-2007, 1:23 PM
    • Member
      point Member
    • stadium
    • Member since 07-31-2007, 4:12 PM
    • Posts 3

    I am not sure if I got you right, but I seem to have problems binding one dataset, never mind 5, I am trying to bind in page_load to just a single Pane and it shows up, but nothin appears in the pane. If I try to fill five datasets, am I to bind these to five panes?, I am not sure how to do this as i am new to ajax controls. Here is my code:

    protected void Page_Load(object sender, EventArgs e)

    {

    int MemberID = 7; //for test, this should be binded to session ID or something like that

    TopRatedPhotosLibrary.TopRatedPhotosController MyControl = new TopRatedPhotosLibrary.TopRatedPhotosController();

    DataSet MemberStats = MyControl.GetPane1(MemberID);

    MemberType.Text = MemberStats.Tables[0].Rows[0]["MemberType"].ToString();  //this is for test only

    StorageSize.Text = MemberStats.Tables[1].Rows[0]["StorageSize"].ToString();   //this is for test onlyUserStatsPanel.Visible = true;

    DataList1.DataSource = MemberStats;

    DataList1.DataBind();

    }

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server">

    <title>Untitled Page</title>

    </head>

    <body>

    <form id="form1" runat="server">

    <div>

    <asp:Panel ID="UserStatsPanel" runat="server" Height="230px" Width="324px">

    <asp:TextBox ID="StorageSize" runat="server"></asp:TextBox>

    <asp:TextBox ID="MemberType" runat="server"></asp:TextBox></asp:Panel>

     

    </div>

    <asp:DataList runat="server" id="DataList1">

    <HeaderTemplate>

    <table>

    <tr>

    <td><h1>Member Stats</h1></th>

    </tr>

    </HeaderTemplate>

     

    <ItemTemplate>

    <table>

    <tr><td>Member Type:</td><td><%# DataBinder.Eval(Container, "DataItem.MemberType") %></td></tr>

    <%--this will not bind as the stored procedure is comprised of 9 selects, hence 9 tables(dataset) can i alter DataItem.StorageSize to reflect other dataset table? in the same pane

    <tr><td>Storage Size:</td><td><%# DataBinder.Eval(Container, "DataItem.StorageSize") %></td></tr>

    --
    %>

    </table>

    </ItemTemplate>

     

    <separatorTemplate>

    <hr>

    </separatorTemplate>

     

    <FooterTemplate>

    </table>

    </FooterTemplate>

    </asp:DataList>

     

    <%--<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetPane1"

    TypeName="TopRatedPhotosLibrary.TopRatedPhotosController">

    <SelectParameters>

    <asp:Parameter DefaultValue="7" Name="MemberID" Type="Int32" />

    </SelectParameters>

    </asp:ObjectDataSource>--
    %>

    </form>

    </body>

    </html>

    And I am trying to bind to my BLL as ObjectdataSource as sqldatasource does not work for me as in this example the SQLquery has 10 select's in it with many aggregate values and comes back as many tables (dataset) when i really need it in one table

     
    Filed under:
Page 1 of 1 (4 items)