Hello Syncfusion,
I am having a batch edit grid in which I have a column that is supposed to be a multiselect dropdown, however, I have written method to bind the column both on saving and returning records, however, I am getting a build up error on my project as you can see in the screen below:
How can I achieve a proper function multi select dropdown that is having a datasource from the Microsoft SQL Server.Below in the grid column snippet of my multi select dropdown.
<GridColumn Field=@nameof(CouncilofDecisionsCountry.NonImplementationReason) HeaderText="Reason for Non/Delayed Implementation" Width="150">
<EditTemplate Context="NonImpReasonContext">
@{
List<int> c = new List<int>();
if (!string.IsNullOrEmpty((NonImpReasonContext as CouncilofDecisionsCountry).NonImplementationReason))
{
var a = (NonImpReasonContext as CouncilofDecisionsCountry).NonImplementationReason.Split(',');
foreach (var n in a)
{
//int b = Convert.ToInt32(n.Trim());
int b = Convert.ToInt32(n.Trim());
c.Add(b);
}
}
<SfMultiSelect @bind-Value="@(c.ToArray())" DataSource="@NonImplementationReasonData" TValue="int[]" TItem="ANonImplementationReasons"></SfMultiSelect>
<MultiSelectFieldSettings Value="@nameof(ANonImplementationReasons.Id)" Text="@nameof(ANonImplementationReasons.Name)"></MultiSelectFieldSettings>
}
</EditTemplate>
<Template Context="NonImplemReasonsContext">
@{
var d = (NonImplemReasonsContext as CouncilofDecisionsCountry).NonImplementationReason;
<span>@String.Join(",", d)</span>
}
</Template>
</GridColumn>
I have attached the razor page in which I am doing this as shown below and the model class of my database table.
Thank You
Hi Vignesh,
I am glad to inform you that the solution you provided to me here last has helped me achieve what I wanted.
Thank You very much.