in
Forums
Blogs
DevExpress.com
Client Center
Support Center
DevExpress Channel

ASPxCallbackPanel adding a second ListBox

Last post 12/17/2008 8:29 AM by ioannis giannis. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12/7/2008 4:29 PM

    ASPxCallbackPanel adding a second ListBox

    Is it possible to add a second ListBox in the code of ASPxCallbackPanel example ( http://demos.devexpress.com/ASPxperienceDemos/CallbackPanel/Example.aspx ) ??

    I am adding a new ListBox with a new DataSourceID:

    <dxe:ASPxListBox runat="server" Height="221px" Width="147px" TextField="Name" DataSourceID="AccessDataSource3" ValueField="EmployeeID" ID="ASPxListBox1" 
    ClientInstanceName="ListBox" BackColor="Transparent">

    and then i add a new DataSource with a different SELECT QUERY:

     <asp:AccessDataSource ID="AccessDataSource3" runat="server" DataFile="~/App_Data/nwind.mdb" SelectCommand="SELECT [EmployeeID], [FirstName] + ' ' + [LastName] AS [Name]

    FROM [Employees]
    WHERE ([EmployeeID] > 10)

    ORDER BY 2" />

    but unfortunately it doesnt work.Can you help me please ?

     



  • 12/9/2008 10:16 AM In reply to

    Re: ASPxCallbackPanel adding a second ListBox

    To be more specific.

    After inserting a new ASPxListBox  with ID="ASPxListBox2" and a new DataSource with ID="AccessDataSource3", i change the behind-code like that (using the ASPxListBox_ValueChanged() sub):

    VB:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            DataBind()
            ASPxListBox1.SelectedIndex = ASPxListBox1.Items.IndexOfValue(AccessDataSource2.SelectParameters("PeopleID").DefaultValue)
        End Sub

        Protected Sub ASPxListBox2_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ASPxListBox2.ValueChanged
            AccessDataSource2.SelectParameters("PeopleID").DefaultValue = ASPxListBox2.SelectedItem.Value.ToString()
            DataBind()
        End Sub

        Protected Sub ASPxListBox1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ASPxListBox1.ValueChanged
            AccessDataSource2.SelectParameters("PeopleID").DefaultValue = ASPxListBox1.SelectedItem.Value.ToString()
            DataBind()
        End Sub

    but the ASPxRoundPanel still displays data from one of the two ListBoxes.

    What's going wrong?

    Thank you for your support DevExpressersSmile

     

  • 12/10/2008 3:48 AM In reply to

    Re: ASPxCallbackPanel adding a second ListBox

    Hello

    I don't quite understand what you want to achieve without taking a look at you entire project, but I can try to suppose.
    Since the ASP.NET viewstate isn't persisted during callbacks, you need to set both datasource parameters in both listboxes' ValueChanged event handlers.
    If it doesn't help you, please feel free to send you project to our Support Center.

    Thanks, Roman
    R&D, .Net Team
    Developer Express Inc.

    PS. If you wish to receive direct assistance from our Support Team, use Support Center.
  • 12/17/2008 8:29 AM In reply to

    Re: ASPxCallbackPanel adding a second ListBox

    Roman thank you very much for your interest,

    check my project at the Support Center link : http://www.devexpress.com/Support/Center/p/Q139593.aspx

    I havent find a solution yet...

Page 1 of 1 (4 items)
Copyright © 1998-2009 Developer Express Inc.
ALL RIGHTS RESERVED