RadComboBox Web Forms Get button element and add attribute

1 Answer 80 Views
ComboBox
John
Top achievements
Rank 1
John asked on 17 Jan 2023, 07:23 PM | edited on 18 Jan 2023, 01:50 PM

Can anyone help with how to set name attribute within button element of Rad Combo Box?  

The button appears when html is rendered - <button class="rcbActionButton" tabindex="-1" type="button">

Either client side or server side will work.

1 Answer, 1 is accepted

Sort by
0
Valentin Dragnev
Telerik team
answered on 20 Jan 2023, 03:50 PM

Hello John,

Yes, you can set the name property of the RadComboBox control button using the client-side event. Please see the shown code below:

<script>
    function OnClientLoadHandler(sender) {
        $("#RadComboBox1").find("button").attr("name", "buttonName");
    }
</script>

<telerik:RadComboBox ID="RadComboBox1" runat="server" OnClientLoad="OnClientLoadHandler" RenderMode="Lightweight">
    <Items>
        <telerik:RadComboBoxItem Text="Item 1" />
        <telerik:RadComboBoxItem Text="Item 2" />
        <telerik:RadComboBoxItem Text="Item 3" />
        <telerik:RadComboBoxItem Text="Item 4" />
    </Items>
</telerik:RadComboBox>  

 

Please give a try to my suggestion and let me know if any more questions arise. 

 

Regards,


Valentin Dragnev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
ComboBox
Asked by
John
Top achievements
Rank 1
Answers by
Valentin Dragnev
Telerik team
Share this question
or