This is a migrated thread and some comments may be shown as answers.

Bind Listbox without postback after selected ComboBox

4 Answers 140 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Naunton
Top achievements
Rank 1
Naunton asked on 07 Jan 2011, 09:07 AM
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 ?


4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Jan 2011, 10:53 AM
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.
0
Naunton
Top achievements
Rank 1
answered on 10 Jan 2011, 04:20 AM
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.
0
Accepted
Dimitar Terziev
Telerik team
answered on 10 Jan 2011, 03:17 PM
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.
0
Naunton
Top achievements
Rank 1
answered on 11 Jan 2011, 02:59 AM
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..
Tags
ListBox
Asked by
Naunton
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Naunton
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Share this question
or