Skip to content

Commit

Permalink
2.0.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurioli committed Feb 2, 2022
1 parent a5a514a commit a169024
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Binary file removed Blazor.WebForm.Components.2.0.0.7.nupkg
Binary file not shown.
Binary file added Blazor.WebForm.Components.2.0.0.8.nupkg
Binary file not shown.
13 changes: 12 additions & 1 deletion Blazor.WebForm.Components/Base/ListControlComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace Blazor.WebForm.UI.ControlComponents
public abstract class ListControlComponent<TControl> : DataBoundControlComponent<TControl>
where TControl : ListControl, new()
{
private bool _hasBindSelectedValue;

[Parameter]
public string ValidationGroup
{
Expand All @@ -34,7 +36,14 @@ public virtual string SelectedValue
}
set
{
this.Control.SelectedValue = value;
if (_hasBindSelectedValue)
{
((IBindingListControl)this.Control).SelectedValue = value;
}
else
{
this.Control.SelectedValue = value;
}
}
}

Expand Down Expand Up @@ -192,8 +201,10 @@ protected override void OnInitialized()
base.OnInitialized();
if (this.HasPropertyBindEvent<string>(nameof(this.SelectedValue)))
{
_hasBindSelectedValue = true;
this.Control.AutoPostBack = true;
this.Control.SelectedIndexChanged += this.BindSelectedIndexChanged;
((IBindingListControl)this.Control).DataBindingSelectedIndexChanged += this.BindSelectedIndexChanged;
if (this.HasEventProperty(nameof(this.OnSelectedIndexChanged)))
{
this.SetBindEventProperty(nameof(this.OnSelectedIndexChanged), this.BindSelectedIndexChanged);
Expand Down
4 changes: 2 additions & 2 deletions Blazor.WebForm.Components/Blazor.WebForm.Components.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Blazor.WebForm.Components.pfx</AssemblyOriginatorKeyFile>
<Version>2.0.0.7</Version>
<Version>2.0.0.8</Version>
<RootNamespace>asp</RootNamespace>
<Copyright>Jurio li</Copyright>
<AssemblyName>Blazor.WebForm.Components</AssemblyName>
Expand All @@ -17,7 +17,7 @@

<ItemGroup>
<PackageReference Include="Applied" Version="1.2.1.6" />
<PackageReference Include="Blazor.WebForm.UI" Version="2.0.0.7" />
<PackageReference Include="Blazor.WebForm.UI" Version="2.0.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.1" />
</ItemGroup>

Expand Down

0 comments on commit a169024

Please sign in to comment.