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

using RadAJAX Manager with RadComboBox Or DropDownList

3 Answers 179 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alaaeddin Alweish
Top achievements
Rank 1
Alaaeddin Alweish asked on 03 May 2010, 12:13 PM
Hello ,,

I've two RadComboBox one for the Region and the other for the Place,,

                <telerik:RadComboBox ID="ddl_Regions" runat="server" Skin="WebBlue" Filter="Contains" 
                    Width="200px" AutoPostBack="True" CssClass="Lists">  
                </telerik:RadComboBox> 
 
                <telerik:RadComboBox ID="ddl_Places" runat="server" Skin="WebBlue" Filter="Contains" 
                    Width="200px" CssClass="Lists">  
                </telerik:RadComboBox> 

When the user choose a Region the Place list will rebind and get the Places of  the selected Region

                    Dim Places As New BusinessLayer.Placess  
                    Places.GetByRegionID(ddl_Regions.SelectedValue)  
                    ddl_Places.DataSource = Places  
                    ddl_Places.DataTextField = "Name" 
                    ddl_Places.DataValueField = "ID" 
                    ddl_Places.DataBind()  
 

everything was fine until i put the Region

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="ddl_Regions" /> 
                <telerik:AjaxUpdatedControl ControlID="ddl_Places" /> 
                <telerik:AjaxUpdatedControl ControlID="lbl_result" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 

when I did that the application still enter the selectedIndexChanged Event of the ddl_Regions and rebind the places but the ddl_Places does't refresh until i did a postback

Should i do postback everytime i want to rebind the ddl_Places data ,?,,  what's the best way to achieve this?

Thank for help

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 03 May 2010, 12:36 PM
Hello Alaaeddin,

If you are binding the second combo (ddl_Places) in 'SelectedIndexChanged', then add the AjaxManager-AjaxSetting accordingly.

ASPX:
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="ddl_Regions" /> 
                <telerik:AjaxUpdatedControl ControlID="ddl_Places" /> 
                <telerik:AjaxUpdatedControl ControlID="lbl_result" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
 
        <telerik:AjaxSetting AjaxControlID="ddl_Regions"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="ddl_Places" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
 
    </AjaxSettings> 
</telerik:RadAjaxManager> 

C#:
 
protected void ddl_Regions_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) 
    // Populate the ddl_Places combo 


Regards,
Princy.
0
Alaaeddin Alweish
Top achievements
Rank 1
answered on 03 May 2010, 01:46 PM
That it is ,, I'm grateful to you princy,,,
0
Vignesh
Top achievements
Rank 1
answered on 26 Nov 2011, 12:32 PM
Hi Princy when i'm doing this focus is moving to my Page not to the next control... canu help me for this..
<telerik:RadAjaxManager ID="ajaxManager1" runat="server" UpdatePanelsRenderMode="Block" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ajaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlCountry" />
                    <telerik:AjaxUpdatedControl ControlID="ddlCity" />
                    <telerik:AjaxUpdatedControl ControlID="ddlState" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ddlCountry">
            <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlCity" />
                    <telerik:AjaxUpdatedControl ControlID="ddlState" />
            </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ddlState">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlCity" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
Tags
General Discussions
Asked by
Alaaeddin Alweish
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Alaaeddin Alweish
Top achievements
Rank 1
Vignesh
Top achievements
Rank 1
Share this question
or