MarkFirstMatch and what is displayed to user

2 posts, 1 answers
  1. dhuss
    dhuss avatar
    120 posts
    Member since:
    Sep 2009

    Posted 22 Apr 2014 Link to this post

    I have a multi-column combobox that the user wants an ID to show in the box but be able to search on a name using the MarkFirstMatch. What I have noticed is the MarkFirstMatch works on the item.text when the databound event fires. If I set the ID to the text property then you can't search by name. If I set the name to the text property you can search by name but it will not display the ID. Is there anyway to get around this. I have tried the OnItemsRequested but the users don't like the list to get shortned, they just want the hi-light to go to the rows as they type.

    telerik:RadComboBox ID="radCBTaxonomy" runat="server" AllowCustomText="true" HighlightTemplatedItems="true"
        DropDownWidth="350px" Width="125px" MaxHeight="200px" OnClientKeyPressing="ChangeToUpperCase" MarkFirstMatch="true"
        OnClientLoad="ChangeToUpperCase" AutoPostBack="true">
            <table style="width: 300px; text-align: left; font-size: 8pt">
                    <td style="width: 100px;">
                        Taxonomy Code
                    <td style="width: 200px;">
            <table style="width: 300px; text-align: left; font-size: 8pt">
                    <td style="width: 100px; text-transform: uppercase;">
                        <%#DataBinder.Eval(Container.DataItem, "Taxonomy")%>
                    <td style="width: 200px; text-transform: uppercase;">
                        <%# DataBinder.Eval(Container.DataItem, "ProvName")%>

    ItemDatabound event
    e.Item.Text = (DirectCast(e.Item.DataItem, DataRowView))("ProvName").ToString.ToUpper()
    e.Item.Value = (DirectCast(e.Item.DataItem, DataRowView))("Taxonomy").ToString.ToUpper()

  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Apr 2014 in reply to dhuss Link to this post

    Hi dhuss,

    RadComboBox supports automatic completion of the text typed in the input area. The text is completed to the match, which is found among the items from the Items collection of the control. This behavior of RadComboBox is enabled/disabled by the MarkFirstMatch property which takes Boolean for a value. The MarkFirstMatch property will check with the Text property of the RadComboBox. In your scenario if you set the ID as the Text property then it will match only with the ID of the Item and in DropDownBox it will highlight that particular item and in the input area it will only show the ID. This is the expected behavior of the control.

    Let me know if you have any concern.
Back to Top