SfComboBox and SfDropDownList value not bind with parent object.
When I upgrade my current project syncfusion version to 4.0 then my old cold was stop the working.
Attachment: BlazorApp1_773aab05.7z
I bind my grid with class ClsMechanismofInjury and in one grid column with field ClsMechanismofInjury.MOIExposureOrigin I used Sfcombobox in this grid.
SFCombox used data source from clsMOIExposureDdlList and object type for this is ClsMOIExposureDdl.
When I open the site then Sfboxbox value appeared perfect as below.
https://imgur.com/zi55ymx
but when I click on Update button then on in Args.data that value for MOIExposureOrigin is showing null for the ClsMechanismofInjury.MOIExposureOrigin.
https://imgur.com/0OvSC0b
I have also attached my project so can you please guide what's the wrong I am doing in it ? Before this code was working good but after update we face this issue.
This same issue I am facing for the SfDropDownList too.
<GridColumn Field=@nameof(ClsMechanismofInjury.MOIExposureOrigin) Width="450" HeaderText="MOI/Exposure Origin" Format="C2" EditType="EditType.DropDownEdit" DataSource="@clsMOIExposureDdlList">
<EditTemplate>
<SfComboBox PopupWidth="250" AllowCustom="false" Placeholder="Select MOI or Exposure Origin" ID="MOIExposureOrigin" Value="@((context as ClsMechanismofInjury).MOIExposureOrigin)" DataSource="@clsMOIExposureDdlList">
<ComboBoxFieldSettings Value="Origin" Text="Origin"></ComboBoxFieldSettings>
</SfComboBox>
</EditTemplate>
</GridColumn>
Attachment: BlazorApp1_773aab05.7z
SIGN IN To post a reply.
5 Replies
1 reply marked as answer
RS
Renjith Singh Rajendran
Syncfusion Team
December 28, 2020 11:44 AM UTC
Hi Karan,
Greetings from Syncfusion support.
We suggest you to set @bind-Value property for the components inside EditTemplate to get the changed values in Args.Data and overcome this reported behavior.
Please refer the codes below,
|
<EditTemplate>
<SfComboBox ... ID="MOIExposureOrigin" @bind-Value="@((context as ClsMechanismofInjury).MOIExposureOrigin)" DataSource="@clsMOIExposureDdlList">
<ComboBoxFieldSettings Value="Origin" Text="Origin"></ComboBoxFieldSettings>
</SfComboBox>
</EditTemplate>
</GridColumn>
|
Please get back to us if you need further assistance.
Regards,
Renjith Singh Rajendran
Marked as answer
KA
Karan
December 28, 2020 09:31 PM UTC
Thank you, this works prefect for us and one more thing I am using the latest syncfusion version 18.4.0.30.
So our Host.chshtml looks like below so is this correct or we need to update anything in below file for version 18.4.0.30?
@page "/"
@namespace TestReview.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using EmbeddedBlazorContent
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CHSFileReview</title>
<base rel='nofollow' href="~/" />
<link rel="stylesheet" rel='nofollow' href="css/bootstrap/bootstrap.min.css" />
<link rel='nofollow' href="_content/Blazored.Typeahead/blazored-typeahead.css" rel="stylesheet" />
<link rel='nofollow' href="css/site.css" rel="stylesheet" />
<link rel='nofollow' href="css/fabric.css" rel="stylesheet" />
<link rel='nofollow' href="css/material.css" rel="stylesheet" />
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap4.css" rel="stylesheet" />
@*<link rel='nofollow' href=" https://cdn.syncfusion.com/blazor/18.1.36-beta/styles/bootstrap4.css" rel="stylesheet" />*@
<link rel='nofollow' href="_content/MatBlazor/dist/matBlazor.css" rel="stylesheet" />
@*<script src="https://cdn.syncfusion.com/blazor/18.3.47/syncfusion-blazor.min.js"></script>*@
<script src="_content/Blazored.Typeahead/blazored-typeahead.js"></script>
@Html.EmbeddedBlazorContent()
</head>
<body>
<app>
@(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))
</app>
<script src="_framework/blazor.server.js"></script>
<script src="_content/Blazored.Typeahead/blazored-typeahead.js"></script>
</body>
</html>
RS
Renjith Singh Rajendran
Syncfusion Team
December 29, 2020 10:45 AM UTC
Hi Karan,
Thanks for your update.
Yes the configuration is fine. Please refer the getting started for your further reference,
And also, hereafter from our Volume 4 releases(18.4.0.30), there is no need to refer the script externally as a cdn. Please refer the below release notes for more details,
Please get back to us if you need further assistance.
Regards,
Renjith Singh Rajendran
KA
Karan
January 6, 2021 02:58 PM UTC
Thanks for help and guide us.
VN
Vignesh Natarajan
Syncfusion Team
January 7, 2021 04:12 AM UTC
Hi Karan,
Thanks for the update.
We are glad to hear that you have resolved your query using our solution.
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan
SIGN IN To post a reply.