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.
Unfortunately, activation email could not send to your email. Please try again.

How to set the value in MultiColumn

Thread ID:

Created:

Updated:

Platform:

Replies:

127290 Nov 8,2016 05:42 AM Nov 9,2016 06:49 AM ASP.NET MVC 1
loading
Tags: AutoComplete
Chandan
Asked On November 8, 2016 05:42 AM

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

Prasanth Palani [Syncfusion]
Replied On November 9, 2016 06:49 AM

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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;