Bind Listbox without postback after selected ComboBox

5 posts, 1 answers
  1. Naunton
    Naunton avatar
    70 posts
    Member since:
    Jun 2010

    Posted 07 Jan 2011 Link to this post

    Hi all,

    I have a ComboBox and and ListBox.

    After selected at ComboBox, get value from ComboBox and pull data from database then bind to listbox without postback.
    How I to do please?
    At which event I have to pull data for listbox ?


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Jan 2011 Link to this post

    Hello Naunt,

    You can achieve the desired functionality by either using RadAjaxManager or RadAjaxPanel.

    Please go through the following documentation for more on this,

    AJAX Manager
    AJAX Panel

    Thanks
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Naunton
    Naunton avatar
    70 posts
    Member since:
    Jun 2010

    Posted 09 Jan 2011 Link to this post

    Hi Shinu,

    Could you please advise again?
    I have bind listbox as the following at RadAjaxManager1_AjaxRequest event.

    ListBox1.DataTextField = "Desc"
    ListBox1.DataValueField = "ID"
    ListBox1.DataSource = dt
    ListBox1.DataBind()
    Data didn't show out in ListBox1.

    But when I look at Watch window like this   ListBox1.Items.count it shows me 5 , when I look detail  ListBox1.Items(0).text it shows "AAA".
    So this mean data are already in Listbox, but just not show.

    Please advise how I can show these data?
    Here is my Listbox sourcecode
    <telerik:RadListBox ID="ListBox1" runat="server" CheckBoxes="True"
                Skin="Default" Height="300px" >
            </telerik:RadListBox>

    Please Help...

    Thanks and best regard.
  5. Answer
    Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 10 Jan 2011 Link to this post

    Hello Naunt,

    With the code provided there shouldn't be any problem.

    I've prepared a small example project showing how to populate listbox based on combobox item selection.

    Best wishes,
    Dimitar Terziev
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  6. Naunton
    Naunton avatar
    70 posts
    Member since:
    Jun 2010

    Posted 10 Jan 2011 Link to this post

    Thanks million, for the example.
    By reference your example, have found out that I made wrong AjaxSetting yesterday instead of must set "RadAjaxManager1" I set "RadCombo1".

    The right must be..
    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ListBox1" />
                    </UpdatedControls>
    </telerik:AjaxSetting>

    This is because of my wrong understanding on RadAjaxManager.

    Thank you again for save my day..
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017