Skip to content

Commit

Permalink
Merge branch 'master' into addDisabledPropertyToRadzenPickList
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsNocore authored Feb 5, 2025
2 parents b310d76 + 456ab29 commit 4135b8e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Radzen.Blazor/RadzenPickList.razor
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<RadzenListBox @bind-Value=@selectedSourceItems Data="@source" Multiple="@Multiple" @bind-SearchText=@sourceSearchText
FilterAsYouType=true FilterCaseSensitivity=FilterCaseSensitivity.CaseInsensitive
TextProperty="@TextProperty" DisabledProperty="@DisabledProperty" AllowFiltering=@AllowFiltering ItemRender="@OnSourceItemRender"
Template=@ListBoxTemplate Placeholder="@(SourcePlaceholder ?? Placeholder)" SelectAllText="@SelectAllText"
Template=@ListBoxTemplate Placeholder="@(SourcePlaceholder ?? Placeholder)" SelectAllText="@SelectAllText" AllowSelectAll="@AllowSelectAll"
Disabled=@(Disabled || Source == null || (Source != null && !Source.Any()))
/>
</RadzenStack>
Expand All @@ -36,7 +36,7 @@
<RadzenListBox @bind-Value=@selectedTargetItems Data="@target" Multiple="@Multiple" @bind-SearchText=@targetSearchText
FilterAsYouType=true FilterCaseSensitivity=FilterCaseSensitivity.CaseInsensitive
TextProperty="@TextProperty" DisabledProperty="@DisabledProperty" AllowFiltering=@AllowFiltering ItemRender="@OnTargetItemRender"
Template=@ListBoxTemplate Placeholder="@(TargetPlaceholder ?? Placeholder)" SelectAllText="@SelectAllText"
Template=@ListBoxTemplate Placeholder="@(TargetPlaceholder ?? Placeholder)" SelectAllText="@SelectAllText" AllowSelectAll="@AllowSelectAll"
Disabled=@(Disabled || Target == null|| (Target != null && !Target.Any()))
/>
</RadzenStack>
Expand Down
7 changes: 7 additions & 0 deletions Radzen.Blazor/RadzenPickList.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public partial class RadzenPickList<TItem> : RadzenComponent
[Parameter]
public bool Multiple { get; set; }

/// <summary>
/// Gets or sets a value indicating whether selecting all items is allowed.
/// </summary>
/// <value><c>true</c> if selecting all items is allowed; otherwise, <c>false</c>.</value>
[Parameter]
public bool AllowSelectAll { get; set; } = true;

/// <summary>
/// Gets or sets a value indicating whether component is disabled.
/// </summary>
Expand Down
8 changes: 7 additions & 1 deletion RadzenBlazorDemos/Pages/PickListConfig.razor
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
Multiple selection
<RadzenSwitch @bind-Value="@multiple" Style="margin-top: 4px;" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "enable multiple selection" }})" />
</RadzenStack>
<RadzenStack Orientation="Orientation.Vertical" Gap="4px" Visible="@multiple">
Allow select all
<RadzenSwitch @bind-Value="@allowSelectAll" Style="margin-top: 4px;" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "allowSelectAll" }})" />
</RadzenStack>
<RadzenStack Orientation="Orientation.Vertical" Gap="4px">
Show header
<RadzenSwitch @bind-Value="@showHeader" Style="margin-top: 4px;" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "show header" }})" />
Expand Down Expand Up @@ -77,6 +81,7 @@
<RadzenPickList AllowMoveAll="@allowMoveAll" AllowMoveAllSourceToTarget="@allowMoveSourceToTarget" AllowMoveAllTargetToSource="@allowMoveTargetToSource" @bind-Source="@Source" @bind-Target="@Target" Style="height:500px; width:100%;" Orientation="@orientation"
TextProperty="@nameof(Customer.CompanyName)" AllowFiltering="@allowFilter" Multiple="@multiple" ShowHeader="@showHeader" Disabled="@disabled"
ButtonGap="@gap" ButtonJustifyContent="@justifyContent" ButtonStyle="@style" ButtonSize="@size" ButtonShade="@shade" ButtonVariant="@variant"
AllowSelectAll="@allowSelectAll"
ItemRender="OnItemRender">
<SourceHeader>
Customers:
Expand All @@ -102,6 +107,7 @@
string gap = "12px";
bool allowFilter = true;
bool multiple = false;
bool allowSelectAll = true;
bool showHeader = true;
bool disabled;
bool allowMoveAll = true;
Expand All @@ -110,7 +116,7 @@

IEnumerable<Customer> _source;
IEnumerable<Customer> Source
{
{
get
{
return _source;
Expand Down

0 comments on commit 4135b8e

Please sign in to comment.