<SfInPlaceEditor Mode="RenderMode.Inline" TValue="string[]" Type="InputType.MultiSelect" Value="@MultiValue" SubmitOnEnter="true" Model="@MultiModel"></SfInPlaceEditor>
@code {
public string[] MultiValue = new string[] { "Android" };
public MultiSelectModel<string> MultiModel = new MultiSelectModel<string>()
{
DataSource = new List<Complex>() {
new Complex() { Country = new Country() { CountryID = "Australia" }, Code = new Code() { ID = "AU" } },
new Complex() { Country = new Country() { CountryID = "Bermuda" }, Code = new Code() { ID = "BM" } },
new Complex() { Country = new Country() { CountryID = "Canada" }, Code = new Code() { ID = "CA" } },
new Complex() { Country = new Country() { CountryID = "Cameroon" }, Code = new Code() { ID = "CM" } },
new Complex() { Country = new Country() { CountryID = "Denmark" }, Code = new Code() { ID = "DK" } },
new Complex() { Country = new Country() { CountryID = "France" }, Code = new Code() { ID = "FR" } }
},
Fields = new FieldSettingsModel { Text = "Country.CountryID", Value = "Code.ID" }
};
public class Code
{
public string ID { get; set; }
}
public class Country
{
public string CountryID { get; set; }
}
public class Complex
{
public Country Country { get; set; }
public Code Code { get; set; }
}
} |
Hi Haywood,
Greetings from Syncfusion support,We have validated your reported query. Yes, you can bind complex object type data to the Inplace-editor with MultiSelect mode. We have also prepared a sample that tries to meet your requirements.
<SfInPlaceEditor Mode="RenderMode.Inline" TValue="string[]" Type="InputType.MultiSelect" Value="@MultiValue" SubmitOnEnter="true" Model="@MultiModel"></SfInPlaceEditor>@code {public string[] MultiValue = new string[] { "Android" };public MultiSelectModel<string> MultiModel = new MultiSelectModel<string>(){DataSource = new List<Complex>() {new Complex() { Country = new Country() { CountryID = "Australia" }, Code = new Code() { ID = "AU" } },new Complex() { Country = new Country() { CountryID = "Bermuda" }, Code = new Code() { ID = "BM" } },new Complex() { Country = new Country() { CountryID = "Canada" }, Code = new Code() { ID = "CA" } },new Complex() { Country = new Country() { CountryID = "Cameroon" }, Code = new Code() { ID = "CM" } },new Complex() { Country = new Country() { CountryID = "Denmark" }, Code = new Code() { ID = "DK" } },new Complex() { Country = new Country() { CountryID = "France" }, Code = new Code() { ID = "FR" } }},Fields = new FieldSettingsModel { Text = "Country.CountryID", Value = "Code.ID" }};public class Code{public string ID { get; set; }}public class Country{public string CountryID { get; set; }}public class Complex{public Country Country { get; set; }public Code Code { get; set; }}}Sample: https://www.syncfusion.com/downloads/support/forum/155864/ze/Inplace-editor_Multiselect960952414Please let us know if the solution helps,
Regards,
Indrajith
@using Syncfusion.Blazor.InPlaceEditor
@using Syncfusion.Blazor.DropDowns
<SfInPlaceEditor Mode="RenderMode.Inline" TValue="string[]" Type="InputType.MultiSelect" TextOption="TextOptionType.Always" Value="@MultiValue" SubmitOnEnter="true" Model="@MultiModel"></SfInPlaceEditor>
@code {
public string[] MultiValue = new string[] { "AU", "BM" };
public MultiSelectModel<string> MultiModel = new MultiSelectModel<string>()
{
DataSource = new List<Complex>() {
new Complex() { Country = new Country() { CountryID = "Australia" }, Code = new Code() { ID = "AU" } },
new Complex() { Country = new Country() { CountryID = "Bermuda" }, Code = new Code() { ID = "BM" } },
new Complex() { Country = new Country() { CountryID = "Canada" }, Code = new Code() { ID = "CA" } },
new Complex() { Country = new Country() { CountryID = "Cameroon" }, Code = new Code() { ID = "CM" } },
new Complex() { Country = new Country() { CountryID = "Denmark" }, Code = new Code() { ID = "DK" } },
new Complex() { Country = new Country() { CountryID = "France" }, Code = new Code() { ID = "FR" } }
},
Fields = new FieldSettingsModel { Text = "Country.CountryID", Value = "Code.ID" }
};
public class Code
{
public string ID { get; set; }
}
public class Country
{
public string CountryID { get; set; }
}
public class Complex
{
public Country Country { get; set; }
public Code Code { get; set; }
}
} |