We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to set the value in MultiColumn

Hi i want to know that how to set the value in Autocomplete Multicolumn in ASP.net MVC5

1 Reply

PP Prasanth Palani Syncfusion Team November 9, 2016 11:49 AM UTC

Hi Chandan, 
 
Thanks for contacting Syncfusion Support. 
 
Query:  I want to know that how to set the value in Autocomplete Multicolumn in ASP.net MVC5  
You can set the value for Autocomplete using the Value property. When multi-column is enabled, the text box value will depend on StringFormat; so, you need to set the value property based on your StringFormat property.  
 
For example, in the below sample, we have set the StringFormat as “{0} ({3}) ({1})" and the Value property is set based on the corresponding column index as like follows “10401 (Albuquerque) (1)”. 
 
 
 
@Html.EJ().Autocomplete("selectCar").Width("100%").WatermarkText("Select an order") 
   .Value("10401 (Albuquerque) (1)").Datasource((IEnumerable<object>)ViewBag.datasource) 
   .HighlightSearch(true).ShowPopupButton(true).MultiColumnSettings(obj =>       obj.Enable(true).Columns(obj1 => 
       { 
           obj1.Field("OrderID").HeaderText("OrderID").Add(); 
           obj1.Field("EmployeeID").HeaderText("EmployeeID").Add(); 
           obj1.Field("CustomerID").HeaderText("CustomerID").Add(); 
           obj1.Field("ShipCity").HeaderText("ShipCity").Add(); 
        }).StringFormat("{0} ({3}) ({1})")) 
 
 
For your reference, we have prepared a simple ASP.NET MVC5 sample for Autocomplete multicolumn support. You can get the sample from, 
 
Sample location: Sample 
 
Please let us know, if you have any further assistance. 
 
Regards, 
Prasanth P 


Loader.
Up arrow icon