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

Selecting an item in a Multicolumn ComboBox

I'm having trouble selecting a row contained in a ComboBox with complex data.  I can only select by index and not by Value or @bind-Value.  Attached is an example. What am I missing?  I'm using


Attachment: mcbo_test_a18c4e70.zip

3 Replies

SP Sureshkumar P Syncfusion Team January 13, 2020 06:06 AM

Hi Dave, 
We would like to inform you that, In the ComboBox TValue property is used to mention the value property type. So when binding the value property as int then you need  to use the TValue as int as mentioned code snippet, 
<EjsComboBox ModelType="Customer_Model" TValue="int?" DataSource="@Customers" @bind-Value="@SelectedIndex" > 
<ComboBoxFieldSettings Text="Company" Value="CustomerID"></ComboBoxFieldSettings> 
<ComboBoxTemplates><ItemTemplate><table><tbody><tr><td style="display:none;">@((context as Customer).CustomerID)</td><td>@((context as Customer).Company)</td><td>@((context as Customer).Last)</td></tr></tbody></table></ItemTemplate></ComboBoxTemplates> 
We have modified your sample. Please find the sample here 
Sureshkumar P 

DA Dave January 13, 2020 08:45 PM

Thank you quick response and insight!

SP Sureshkumar P Syncfusion Team January 14, 2020 04:05 AM

Hi Dave, 
Sureshkumar P 

Live Chat Icon For mobile
Up arrow icon