how RadComboBox in table header change all RadComboBoxs in Repeater

4 posts, 1 answers
  1. AHMED
    AHMED avatar
    8 posts
    Member since:
    Nov 2014

    Posted 27 Mar 2019 Link to this post


    please I need your help in client side code ,

    I need  javascript code that explain how can RadComboBox in header affects on all RadComboBoxs in asp repeater rows,

    how can set same value and same text .



  2. AHMED
    AHMED avatar
    8 posts
    Member since:
    Nov 2014

    Posted 31 Mar 2019 Link to this post

    Please I need your help 


  3. Answer
    Peter Milchev
    Peter Milchev avatar
    631 posts

    Posted 01 Apr 2019 Link to this post

    Hello Ahmed,

    Please provide more details on the exact Repeater and ComboBox configuration and provide more specific examples of what exactly should happen.

    One possible option to access all ComboBoxes in the Repeater would be if you add a custom CSS class to the CssClass property of the ComboBoxes you would like to modify and when needed to use JavaScript to access all combo boxes. Then, you can iterate them, access the client-side object and use their API.

    Here is a very simple example that synchronizes the selected items across all ComboBoxes in the Repeater that have the "myclass" set to the CssClass property: 

        window.isProgrammaticSelection = false;
        function OnClientSelectedIndexChanged(sender, args) {
            if (!window.isProgrammaticSelection) {
                window.isProgrammaticSelection = true;
                var allComboBoxes = $telerik.$(".myclass");
                var value = args.get_item().get_value();
                for (var i = 0; i < allComboBoxes.length; i++) {
                    var combo = allComboBoxes[i].control;
                    var item = combo.findItemByValue(value);
                window.isProgrammaticSelection = false;

    <asp:Repeater ID="Repeater1" OnItemDataBound="Repeater1_ItemDataBound" runat="server">
            <telerik:RadComboBox ID="RadComboBox1" CssClass="myclass" runat="server" RenderMode="Lightweight"
                    <telerik:RadComboBoxItem Text="Item 1" Value="1" />
                    <telerik:RadComboBoxItem Text="Item 2" Value="2" />
                    <telerik:RadComboBoxItem Text="Item 3" Value="3" />
                    <telerik:RadComboBoxItem Text="Item 4" Value="4" />
            <br />

    protected void Page_Load(object sender, EventArgs e)
        Repeater1.DataSource = Enumerable.Range(1, 10).Select(x => "Item " + x.ToString());
    protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        var combo = e.Item.FindControl("RadComboBox1") as RadComboBox;

    Peter Milchev
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.

  4. AHMED
    AHMED avatar
    8 posts
    Member since:
    Nov 2014

    Posted 01 Apr 2019 in reply to Peter Milchev Link to this post

    Thank you very much, you solved my problem :)
Back to Top