Issues caused by updated version

2 posts, 0 answers
  1. A
    A avatar
    1 posts
    Member since:
    Aug 2016

    Posted 08 Aug Link to this post

    Using an older version of telerik, we have a control formed like so:

    [code]
    <asp:DropDownList ID="ddlField" Visible="false" runat="server" AutoPostBack="true"
        Height="20px" Width="126px" AppendDataBoundItems="True" DataSourceID="FieldLookupDS"
        DataTextField="FieldName" DataValueField="FieldPk" CausesValidation="True">
    </asp:DropDownList>
    <telerik:RadComboBox runat="server" ID="radCbField" DataSourceID="FieldLookupDS"
        DataTextField="FieldName" DataValueField="FieldPk" Width="130px" AllowCustomText="true"
        Text="Select">
        <ItemTemplate>
            <asp:CheckBox runat="server" ID="cbField" AutoPostBack="true" Text='<%#Eval("FieldName")%>' />
        </ItemTemplate>
    </telerik:RadComboBox>
    [/code]

    Without change, the old version of the telerik controls allow us to select multiple items in a drop down list with checkboxes, while the default option field remains in place. After updating to a newer version of telerik, clicking on the checkboxes themselves maintains he same effect, but clicking on the label makes that label appear in the option field instead of the desired default prompt. This has been verified by simply switching the versions we are using. 

    Is there any guidance on how to re-implement this functionality in newer versions? 

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    832 posts

    Posted 11 Aug Link to this post

    Hello,

    If I understand correctly what you are trying to achieve, you want the ComboBox not to show the selected item's text in its input, instead to show "Select". You can do that by subscribing to the OnClientSelectedIndexChanged the event and in its handler set the ComboBox' Text with the set_text() method:
    <telerik:RadComboBox runat="server" ID="radCbField" DataSourceID="FieldLookupDS"
        DataTextField="FieldName" DataValueField="FieldPk" Width="130px" AllowCustomText="true"
        Text="Select" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged">

    function OnClientSelectedIndexChanged(sender, args) {
        sender.set_text("Select");
    }


    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top