In place editor with Multiselect. Show first item "plus x more" after change

Hi There,

I've got an in place editor with a multi select.  The behavior I'd like is that once the values are changed (in place editor normal state), the in place editor should show the values selected in the multiselect as "FirstItem + 3 more" as it is shown when editing in the multiselect, however I can't find something that can control this behavior. When the multiselect is in it's normal state, it shows all the selected items, seperated by a comma. Is there a property I can set? 

Code used:

 <SfInPlaceEditor Mode="RenderMode.Inline" EditableOn="EditableType.Click" Type="InputType.MultiSelect" ShowButtons="false" SubmitOnEnter="true" Model="@MultiModel" Value="@MultiValue" >

   </SfInPlaceEditor>  


private string[] MultiValue = new string[] { "Australia", "Bermuda" };
    public MultiSelectModel<string> MultiModel = new MultiSelectModel<string>()
    {
         Mode = VisualMode.CheckBox,
         Placeholder = "Choose a site",
        DataSource = Places,
         ShowSelectAll = true
    };

    public class Countries
    {
        public string text { get; set; }
    }

    private static List<Countries> Places = new List<Countries>()
{
        new Countries(){ text= "Australia" },
        new Countries(){ text= "Bermuda" },
        new Countries(){ text= "Canada" },
        new Countries(){ text= "Cameroon" },
        new Countries(){ text= "Denmark" },
        new Countries(){ text= "Finland" },
        new Countries(){ text= "Greenland" },
        new Countries(){ text= "Poland" }
    };

Attachment: current_d92706fc.zip

1 Reply 1 reply marked as answer

PM Pandiyaraj Muniyandi Syncfusion Team July 2, 2020 01:32 PM UTC

 
Greetings from Syncfusion support. 
 
We have validated your requirement and it can be achievable through workaround solution by using OnActionSuccess event as follows 
 
Note: We doesn’t have any API to achieve this requirement 
 
 
<SfInPlaceEditor> 
    <InPlaceEditorEvents TValue="string" OnActionSuccess="@OnActionSuccess" /> 
</SfInPlaceEditor> 
 
@code{ 
    private void OnActionSuccess(ActionEventArgs args) 
    { 
        // Store submitted editor value as string 
        string value = args.Value.ToString(); 
        // Separate string item to identify the count 
        string[] selectedValues = value.Split(","); 
        if (selectedValues.Length > 1) 
        { 
            int count = selectedValues.Length - 1; 
            // Design required output and assign it to args.Value 
            args.Value = selectedValues[0] + " +" + count + " more"; 
        } 
    } 
} 
 
 
We have prepared sample for your reference, get it from below link 
 
Regards, 
Pandiyaraj 


Marked as answer
Loader.
Up arrow icon