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 11:06 AM UTC

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 14, 2020 01:45 AM UTC

Thank you quick response and insight!

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

Hi Dave, 
Sureshkumar P 

Live Chat Icon For mobile
Up arrow icon