MultiSelect ValueTemplate not displaying
Hello All,
My MultiSelect ItemTemplate is displaying correctly but my ValueTemplate. It shows the ID instead (Intitemsizeid). What is the solution to get ValueTemplate to display the same as ItemTemplate? I think I have the terms correct. ItemTemplate is shown in the drop-down and ValueTemplate is shown in the field at the top.
<SfMultiSelect TValue="int[]"
ModelType="typeof(Tblitemsizelist)"
@bind-Value="ariSelectedSizeIds"
Mode="@VisualMode.CheckBox"
Placeholder="Size..."
DataSource="@lstSizes"
ShowSelectAll="true"
Width="200px"
EnableSelectionOrder="true"
FilterBarPlaceholder="Search Size"
ShowDropDownIcon="true"
PopupHeight="500px">
<MultiSelectTemplates>
<ItemTemplate>
<div>
@((context as Tblitemsizelist).Intwidth) x @((context as Tblitemsizelist).Intlength)
</div>
</ItemTemplate>
<ValueTemplate>
<div>
@((context as Tblitemsizelist).Intwidth) x @((context as Tblitemsizelist).Intlength)
</div>
</ValueTemplate>
</MultiSelectTemplates>
<MultiSelectFieldSettings Value="Intitemsizeid"></MultiSelectFieldSettings>
</SfMultiSelect>
ModelType="typeof(Tblitemsizelist)"
@bind-Value="ariSelectedSizeIds"
Mode="@VisualMode.CheckBox"
Placeholder="Size..."
DataSource="@lstSizes"
ShowSelectAll="true"
Width="200px"
EnableSelectionOrder="true"
FilterBarPlaceholder="Search Size"
ShowDropDownIcon="true"
PopupHeight="500px">
<MultiSelectTemplates>
<ItemTemplate>
<div>
@((context as Tblitemsizelist).Intwidth) x @((context as Tblitemsizelist).Intlength)
</div>
</ItemTemplate>
<ValueTemplate>
<div>
@((context as Tblitemsizelist).Intwidth) x @((context as Tblitemsizelist).Intlength)
</div>
</ValueTemplate>
</MultiSelectTemplates>
<MultiSelectFieldSettings Value="Intitemsizeid"></MultiSelectFieldSettings>
</SfMultiSelect>
SIGN IN To post a reply.
5 Replies
1 reply marked as answer
JM
Jeyanth Muthu Pratheeban Sankara Subramanian
Syncfusion Team
September 2, 2020 05:07 PM UTC
Hi Joseph,
Greetings from Syncfusion support.
We have validated your reported issue. We would like to inform you that, in Multiselect component value template will allow to display only one field in the input. This is control’s intended behavior.
Kindly check with the above suggestion. Please get back us if you need further assistance.
Regards,
Jeyanth
SY
SynAppsDev
replied to Jeyanth Muthu Pratheeban Sankara Subramanian
September 10, 2020 05:22 PM UTC
The source code on page
https://blazor.syncfusion.com/demos/multiselect-dropdown/template?theme=bootstrap4
shows more than one field being used in the ValueTemplate.
PM
Ponmani Murugaiyan
Syncfusion Team
September 11, 2020 01:53 PM UTC
Hi Joseph,
Thanks for the update.
We would like to inform that the online demo sample will support more than one field because it is Multiselect template with Default mode, but your reported case is Multiselect with CheckBox mode. It will not support more than one field. As per our previous update, this is control’s intended behavior for CheckBox mode.
Please get back us, if you need further assistance.
Regards,
Ponmani M
Marked as answer
SY
SynAppsDev
September 16, 2020 04:15 PM UTC
Okay, that wasn't made clear but thanks for letting me know.
JM
Jeyanth Muthu Pratheeban Sankara Subramanian
Syncfusion Team
September 17, 2020 01:01 PM UTC
Hi Joseph,
Most welcome. We are always happy to assist you.
Regards,
Jeyanth.
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
- Marked answer
-
SY SynAppsDev
- Aug 26, 2020 11:32 PM UTC
- Sep 17, 2020 01:01 PM UTC