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

[Solved] HighlightFirstMatch(false) and initial value

1 Answer 93 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mattias
Top achievements
Rank 1
Mattias asked on 27 Oct 2011, 06:58 AM
Hi,
I have 2 questions, first my code:
Html.Telerik()
        .ComboBox()
        .Name("Search")
        .Encode(true)
        .DataBinding(binding => binding.Ajax().Select("SearchInlineResult", "Article").Cache(false).Delay(500))
        .AutoFill(false)
        .HtmlAttributes(new { @class = "fake-autocomplete", style = "color: #888888; width: 250px" })
        .HighlightFirstMatch(false)
        .Filterable(filter => filter.Enabled(false))
        .Value(Request.QueryString["q"])
        .Render();

1. When typing a search phrase, this code still highlights the first item. Why isn't HighlightFirstMatch(false) working here?
2. After making a search, the search form redirects to search result page and there I want the search phrase to be added back to the control but I can't use .Value(Request.QueryString["q"]) for this. So how do I set initial value?

Regards,
Mattias

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 28 Oct 2011, 01:26 PM
Hello Mattias,

 
Straight onto your questions:
#1:
When the filtering of the combobox is turned off it starts to behave like SELECT element. In this case the combobox will not filter the items, but will select an item depending on the user input. 

#2:
You can try InputHtmlAttributes:

InputHtmlAttributes(new { value = Request.QueryString["q"] })

Kind regards,
Georgi Krustev
the Telerik team
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
ComboBox
Asked by
Mattias
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or