SfMultiSelect not working properly in SfGrid EditTemplate


We are using SfMultiselect and SfListView and facing some issues. Your support can help find the issue. 

SfMultiSelect

I have added SfMultiSelect in GridColumn as an EditTemplate as shown in below code.

<GridColumn Field=@nameof(ProvidersListModel.PDegree) HeaderText="Degrees" Width="100" >
                                <EditTemplate>
                                    <SfMultiSelect ID="ProviderDegrees" Placeholder="Degrees" TItem="DegreeModel" TValue="string[]" Value=@((context as ProvidersListModel).ProviderDegrees) DataSource="@Degrees" Mode="VisualMode.Delimiter">
                                        <MultiSelectEvents TItem="DegreeModel" TValue="string[]" OnValueSelect="@DegreeSelectHandler" ValueRemoved="@DegreeRemovedhandler" />
                                        <MultiSelectFieldSettings Text="DegreeName" Value="DegreeId" />
                                    </SfMultiSelect>
                                </EditTemplate>
                            </GridColumn>


Now there are couple of issues here. 

When I try to Edit Grid row, I am unable to show selected values (string array) in multiselect.

 




Second, when I try to select from Drop Down, it doesn't show selected value as well. Your help is required.

Thanks

3 Replies

PM Ponmani Murugaiyan Syncfusion Team January 17, 2022 09:37 AM UTC

Hi Faizan,  
 
Greetings from Syncfusion.  
 
Query: SfMultiSelect not working properly in SfGrid EditTemplate  
 
We have checked your reported query and we could not able to reproduce the reported problem at our end. Here, we have rendered multiselect component in EditTemplate. While editing the record, the selected values are shown properly without any issues. Find the below sample for your reference. 
 
<SfGrid AllowPaging="true" DataSource="@Orders" Toolbar="@(new List<string>() { "Add""Edit""Delete""Cancel","Update" })">  
    <GridEditSettings AllowEditing="true" AllowDeleting="true" AllowAdding="true" Mode="@EditMode.Normal"></GridEditSettings>  
    <GridColumns>  
        . . .  
       <GridColumn Field=@nameof(Order.ChosenItems) HeaderText="Chosen Items" Width="150">  
            <EditTemplate>  
                <SfMultiSelect ID="ChosenItems" @bind-Value="@((context as Order).ChosenItems)"DataSource="@AvailableChoices" TValue="string[]" TItem="MyChoiceItem">  
                    <MultiSelectFieldSettings Value="ChosenItems" Text="ChosenItems"></MultiSelectFieldSettings>  
                </SfMultiSelect>  
            </EditTemplate>  
            <Template>  
                @{  
                    var d = (context as Order).ChosenItems;  
                    <span>@String.Join(",", d)</span>  
                }  
            </Template>  
        </GridColumn>  
        . . .  
   </GridColumns>  
</SfGrid>  
 
 
 
If you are still facing the problem, then could you please share the below details. It will be helpful to validate and provide a better solution.  
 
  1. Reproduce the problem in the provided sample and revert back to us.
  2. Full code snippets of the page.
  3. Share a simple reproduceable sample if possible.
 
Regards,  
Ponmani M 



FM Faizan Mubasher January 17, 2022 02:56 PM UTC

Hi, Thanks for reply. I have been able to resolve issue. 



PM Ponmani Murugaiyan Syncfusion Team January 18, 2022 04:32 AM UTC

Hi Faizan, 

Thanks for the update. We are glad to hear that the issue has been resolved. 

Regards, 
Ponmani M 


Loader.
Up arrow icon