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

[Solved] Auto Complete in MVC razor

1 Answer 189 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.
mian
Top achievements
Rank 1
mian asked on 08 Sep 2011, 06:52 AM
Hi Telerik Team , Hello Everyone ... 

IN MVC I am using strongly type Views with razor syntax , and I have sent a GridModel to my view. can you plz tell with a little example that how to use Auto Complete ComboBox in this situation. plz its very urgent. 

Here is my code... 
@model GridModel<CustomerModel>

  @(Html.Telerik().AutoCompleteFor("")

                                        .BindTo(ViewData["CustomerSearch"] as List<string>)
                                        .HighlightFirstMatch(true)
                                        .AutoFill(true)
                                        .HtmlAttributes(new { @class = "tbox readonly" })
                                    )    
what should i write inside ("")?? ... as I am sending Grid Model , not any list of objects .. 
plz help ... 
Thanx 

1 Answer, 1 is accepted

Sort by
0
John DeVight
Top achievements
Rank 1
answered on 08 Sep 2011, 04:20 PM
Hi Mian,

I switched from the "AutoCompleteFor" to "AutoComplete" to get it to work.  Here is the code:

@(Html.Telerik().AutoComplete()
    .BindTo(ViewData["CustomerSearch"] as List<string>)
    .Name("myAutoComplete")
    .HighlightFirstMatch(true)
    .AutoFill(true)
    .HtmlAttributes(new { @class = "tbox readonly" })
)

Let me know if you still have problems...

Regards,

John DeVight
Tags
ComboBox
Asked by
mian
Top achievements
Rank 1
Answers by
John DeVight
Top achievements
Rank 1
Share this question
or