Preselected Values not Showing in MultiSelect in Grid when Editing (Dialog Mode)

Hi all,

As per the Subject line, I can't seem to get preselected values to show in a MultiSelect Drop-Down in the Edit Dialog of a DataGrid.

I found this previous post:


but cannot seem to get it to work (I'm trying to do the refresh in the ActionBegin Handler when BeginEdit is passed).

Thanks in advance

Simon

17 Replies 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team December 18, 2020 11:44 AM UTC

Hi Simon, 

Greetings from Syncfusion support. 

We have achieved using the Created and DataBound events of Multiselect component. Please find the code below. 

<GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"> 
    <EditTemplate> 
        <SfMultiSelect TValue="string[]" @ref=" mulObj" Placeholder="e.g. Australia" ...> 
            <MultiSelectFieldSettings Value="Code" Text="Name"></MultiSelectFieldSettings> 
            <MultiSelectEvents DataBound="DataBound" Created="Created" TValue="string[]"></MultiSelectEvents> 
        </SfMultiSelect> 
    </EditTemplate> 
</GridColumn> 
 
@code { 
    public bool flag = false; public void Created() 
    { 
        flag = true; 
    } 
    public void DataBound() 
    { 
        if (flag) 
        { 
            mulObj.Refresh(); 
            flag = false; 
        } 
    } 
} 
 


Kindly check with the above sample. Please get back us if you need further assistance. 
  
Regards,  
Ponmani M 


Marked as answer

JD James Dibler April 29, 2022 04:40 PM UTC

In the current version (20.1.0.50) the method "Refresh" is no longer available, and I'm running into this same p



UD UdhayaKumar Duraisamy Syncfusion Team May 2, 2022 12:37 PM UTC

Hi James,


We have already working on the reported issue on our end. The fix will be included in the Volume 1 SP1 release. The Volume 1 SP1 will be released in the second week of May 2022.


You can track the status using the below feedback link.

https://www.syncfusion.com/feedback/33719/need-to-refresh-the-datasource-dynamically-using-remote-data


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”


Regards,

Udhaya Kumar D



UD UdhayaKumar Duraisamy Syncfusion Team May 4, 2022 09:14 AM UTC

Hi James,


We have implemented the “Need to refresh the datasource dynamically using remote data” feature in the latest 20.1.52 version. Now, You can refresh the popup items using the RefreshDataAsync method. So, we suggest you upgrade to our latest version to use this feature.


Please find the release notes here:
https://blazor.syncfusion.com/documentation/release-notes/20.1.52?type=all#features-1


Regards,

Udhaya Kumar D



JO John May 17, 2022 02:48 PM UTC

can someone provide working sample of this solution working with 20.1.0.52-56?   I'm still not seeing a refresh/refreshdataasync option for my sfmultiselect object.



UD UdhayaKumar Duraisamy Syncfusion Team May 18, 2022 06:25 PM UTC

Hi Simon,


We are validating the requirement. We will update the further details in one business day (19th May 2022).


Regards,

Udhaya Kumar D




UD UdhayaKumar Duraisamy Syncfusion Team May 19, 2022 08:30 AM UTC

Hi All,


Please ignore the previous update provided on May 04, As of now RefreshDataAsync method has not included MultiSelect, we will include it in Vol-2 2022 main release. The Vol-2 2022 will be released at end of June. Sorry for the inconvenience caused on your end.


You can track the status using the below feedback link.

https://www.syncfusion.com/feedback/35021/need-to-provide-refreshdataasync-method-for-refresh-the-data-source-dynamically


Regards,

Udhaya Kumar D



JO John May 19, 2022 11:34 PM UTC

thank you for the response and clarification



UD UdhayaKumar Duraisamy Syncfusion Team May 20, 2022 05:30 PM UTC

Hi John,


Thanks for the update. We will update you once the Volume 2 release is rolled out.


Regards,

Udhaya Kumar D



UD UdhayaKumar Duraisamy Syncfusion Team July 2, 2022 05:45 AM UTC

Hi John,


Sorry for the inconvenience caused.


We are resolved this case. Fix in testing phase, we will include in July 12th patch release.


Regards,

Udhaya Kumar D



HA Hassaan July 13, 2022 04:41 PM UTC

This again has not been released in July Patch. What is wrong with you guys ??? This is very basic requirement. Multiselect does not persist selected values inside blazor datagrid in edit mode. Why is this being delayed again and again without providing any work around???



UD UdhayaKumar Duraisamy Syncfusion Team July 14, 2022 03:17 PM UTC

Hi Hassaan,


We have resolved this case. Fix in the testing phase, we will include in July 27th patch release.


Regards,

Udhaya Kumar D



AM Amar July 21, 2022 12:58 PM UTC

MultiSelect doesn't set default values if inside another component:

e.g. Test component using Wrapper component containing doesn't work (passing DataSource and Value as parameters)

Test component using directly works



MM Mohanraj Mathaiyan Syncfusion Team July 24, 2022 05:46 PM UTC

Hi Simon,


We ensured the reported issue based on the shared details, but we cannot replicate the issue in our end as per. we have attached the working sample for your reference. Still if you are facing issue, please modify the attached sample to replicate in our end. This will help us validate the issue further and provide you with a better solution.

[MultiSelectDropdownFeatures.razor]

<div class="control_wrapper">

            <div class="control-styles">

                <h5> Default Mode</h5>

                <SfMultiSelect TValue="string[]" TItem="GameFields" Mode="@VisualMode.Default" Placeholder="Favorite Sports" @bind-Value="value" DataSource="@Games">

                    <MultiSelectFieldSettings Text="Text" Value="ID"></MultiSelectFieldSettings>

                </SfMultiSelect>

               

            </div>

    </div>

    <div>

            <SfDialog Target="#target" Width="500px" ShowCloseIcon="true" @bind-Visible="Visibility">

        <DialogTemplates>

            <Header> About SYNCFUSION succinctly series </Header>

            <Content>

               <SfMultiSelect TValue="string[]" TItem="GameFields"  Mode="VisualMode.CheckBox" Placeholder="Favorite Sports" @bind-Value="value" DataSource="@Games">

                    <MultiSelectFieldSettings Text="Text" Value="ID"></MultiSelectFieldSettings>

                </SfMultiSelect>

            </Content>

        </DialogTemplates>

        <DialogButtons>

            <DialogButton IsPrimary="true" Content="<a id='newTab' rel='nofollow' href='https://www.syncfusion.com/company/about-us' target='_blank'>Learn More</a>" OnClick="@OnBtnClick" />

        </DialogButtons>

    </SfDialog>

    </div>


If the above solution does not solve your problem, can you please share more information about your requirement?


Regards,

Mohanraj M


Attachment: multiselect_338cded7_e91dbbb6.zip


UD UdhayaKumar Duraisamy Syncfusion Team August 12, 2022 10:20 AM UTC

Hi All,


We have implemented the “Need to provide RefreshDataAsync method for Refresh the data source dynamically” feature in the latest 20.2.43 version. Now, You can refresh the popup items using the RefreshDataAsync method. So, we suggest you upgrade to our latest version to use this feature.


Sample  https://www.syncfusion.com/downloads/support/directtrac/general/ze/RefreshDataAsync1278632215


Regards,

Udhaya Kumar D



DA Devrim Akdas December 20, 2024 12:55 PM UTC

This problem still persists. In the dialog opened with Grid Edit, the previously selected items do not appear with a checkbox. Has anyone solved the problem?

Image_6403_1734699312414




YS Yohapuja Selvakumaran Syncfusion Team December 24, 2024 01:51 PM UTC

Hi Devrim,

Thank you for reaching out to us. We have carefully validated the reported issue regarding the selected value being displayed with a checkbox. To assist you better, we have created a sample for your reference and tested it on our end.

However, we couldn't replicate the issue as described. In our sample, the selected value is displayed correctly with the checkbox as expected. You can find the sample here:

Sample: https://blazorplayground.syncfusion.com/LZLJsVhpzuTSagEU




We kindly request you to review the provided sample and compare it with your implementation. If the issue persists or differs from the provided scenario, please share more details or a sample replicating the issue. This will help us investigate further and provide a more accurate resolution.

We appreciate your patience and cooperation.


Regards,

Yohapuja S


Loader.
Up arrow icon