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

RadcomboBox and RadAjaxManager not worked

2 Answers 117 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Phuoc Nguyen Thanh
Top achievements
Rank 1
Phuoc Nguyen Thanh asked on 29 Apr 2010, 02:39 AM
Dear telerik team
I use RadcomboBox and RadAjaxManager. RadcomboBox SelectedIndexChanged event. There is a problem if RadcomboBox RadAjaxManager using the commands in the SelectedIndexChanged method is not implemented correctly. And if you do not use RadAjaxManager, then use normally.
I started the project attached for your reference and help me solve the problem.
Sincerely

File :
http://www.mediafire.com/file/nb3gj4mytqz/AjaxTest.rar

2 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 29 Apr 2010, 02:05 PM
Hi Phuoc,

To achieve the desired functionality you could try to add the "CategoryName" as a RadComboBox. DataTextField's value:
<telerik:RadComboBox ID="RadCboCategories" Runat="server" Height="190px" Width="300px" MarkFirstMatch="true"  EnableLoadOnDemand="true" HighlightTemplatedItems="true" DataTextField="CategoryName" DropDownWidth="300px" DataValueField="CategoryID"ItemRequestTimeout="500" AutoPostBack="true" OnItemsRequested="RadCboCategories_ItemsRequested" Skin="Outlook" TabIndex="1"
onselectedindexchanged="RadCboCategories_SelectedIndexChanged">
<HeaderTemplate>
...

Into the RadCboCategories.SelectedIndexChanged event handler you could try getting the RadCboCategories.SelectedValue instead of RadCboCategories.Text:
protected void RadCboCategories_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
        string CategoryID = RadCboCategories.SelectedValue.Trim();
        //Loadlable(CategoryID);
...

Also to update the lblCategoryName you need to add it into the RadAjaxManager's UpdatedControls collection:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadCboCategories">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadCboCategories" LoadingPanelID="RadAjaxLoadingPanel1"/>
                <telerik:AjaxUpdatedControl ControlID="lblCategoryName"  />
                  <telerik:AjaxUpdatedControl ControlID="lblDescription"  />
            </UpdatedControls>
        </telerik:AjaxSetting>       
    </AjaxSettings>
</telerik:RadAjaxManager>

Additionally I am sending you a modified version of your project. Please check it out and let me know if it helps you.

Regards,
Radoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Phuoc Nguyen Thanh
Top achievements
Rank 1
answered on 03 May 2010, 07:33 AM
Dear Radoslav
the Telerik team

Thank you for helping me solve the problem. It worked very well.

Regards
Tags
Ajax
Asked by
Phuoc Nguyen Thanh
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Phuoc Nguyen Thanh
Top achievements
Rank 1
Share this question
or