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

EmptyMessage Problem

1 Answer 39 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Syed
Top achievements
Rank 1
Syed asked on 28 Nov 2013, 03:11 AM

Hi There

I have a RadComboBox

And definition look like this

<telerik:RadComboBox Filter="Contains" runat="server" ID="cmbTechnicalServicePerson" Width="420px"

        MarkFirstMatch="true" DataSourceID="DSGetTechnicalServicePerson"

        HighlightTemplatedItems="true" OnClientItemsRequested="UpdateItemCountField"

        OnDataBound="cmbTechnicalServicePerson_DataBound" OnItemDataBound="cmbTechnicalServicePerson_ItemDataBound"

        LabelWidth="100" Label="Technical Service Name:" Skin="Office2010Black" Style="position: absolute; top: 310px; left: 21px; z-index: 6500; height: 16px;" EmptyMessage="Select  a Value" TabIndex="3">

        <HeaderTemplate>

            <ul>

                <li class="col1">Name</li>

                <li class="col2">Position</li>

                <li class="col2">Unit</li>

            </ul>

        </HeaderTemplate>

        <ItemTemplate>

            <ul>

                <li class="col1">

                    <%# DataBinder.Eval(Container.DataItem, "[FULLNAME]")%></li>

                <li class="col2">

                    <%# DataBinder.Eval(Container.DataItem, "Position")%></li>

                <li class="col3">

                    <%# DataBinder.Eval(Container.DataItem, "[Department]")%></li>

            </ul>

        </ItemTemplate>

        <FooterTemplate>

            A total of

                    <asp:Literal runat="server" ID="RadComboItemsTCount" />

            items

        </FooterTemplate>

 

    </telerik:RadComboBox>

Some time user would like to un select the selected value but this setting  does not allow them. Initial the EmptyMessage="Select  a Value" appear but as soon as they select something they will not be able to unselect to the empty value

Can someone please give some suggestion?

Many thanks

Syed

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 02 Dec 2013, 09:41 AM
Hello Syed,

I would suggest you to use the OnClientBlur client-side event of the RadComboBox and clear the selection of the control, if the text is an empty string. Please consider the following implementation:

function OnClientBlur(sender) {
          if (sender.get_text() == "") {
              sender.clearSelection();
          }
      }


Regards,
Nencho
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ComboBox
Asked by
Syed
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or