Forums

ASPxCallbackPanel adding a second ListBox

Last post 12/17/2008 8:29 AM by ioannis giannis. 3 replies.
Sort Posts: Previous Next
  • ioannis giannis

    ASPxCallbackPanel adding a second ListBox

    12/7/2008 4:29 PM
    • Not Ranked
    • Joined on 11/13/2008
    • Posts 14

    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 ?

     



  • ioannis giannis

    Re: ASPxCallbackPanel adding a second ListBox

    12/9/2008 10:16 AM
    • Not Ranked
    • Joined on 11/13/2008
    • Posts 14

    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

     

  • Roma R (DevExpress)

    Re: ASPxCallbackPanel adding a second ListBox

    12/10/2008 3:48 AM
    • Top 50 Contributor
    • Joined on 5/4/2007
    • Posts 486

    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, DevExpress

    PS. If you wish to receive direct assistance from our Support Team, use Support Center.
  • ioannis giannis

    Re: ASPxCallbackPanel adding a second ListBox

    12/17/2008 8:29 AM
    • Not Ranked
    • Joined on 11/13/2008
    • Posts 14

    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...

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.