mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-02-04 05:35:44 +00:00
DataGrid GroupRowRenderEventArgs Expandable property added
This commit is contained in:
@@ -17,6 +17,12 @@ public class GroupRowRenderEventArgs
|
||||
/// </summary>
|
||||
public Group? Group { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this group row is expandable.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if expandable; otherwise, <c>false</c>.</value>
|
||||
public bool Expandable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this group row is expanded.
|
||||
/// </summary>
|
||||
|
||||
@@ -2510,7 +2510,7 @@ namespace Radzen.Blazor
|
||||
|
||||
internal Tuple<GroupRowRenderEventArgs, IReadOnlyDictionary<string, object>> GroupRowAttributes(RadzenDataGridGroupRow<TItem> item)
|
||||
{
|
||||
var args = new Radzen.GroupRowRenderEventArgs() { Group = item.Group, FirstRender = firstRender };
|
||||
var args = new Radzen.GroupRowRenderEventArgs() { Group = item.Group, FirstRender = firstRender, Expandable = item.GroupResult.Count > 0 };
|
||||
|
||||
if (GroupRowRender != null)
|
||||
{
|
||||
|
||||
@@ -26,9 +26,12 @@
|
||||
}
|
||||
<td class="rz-col-icon">
|
||||
<span class="rz-column-title"></span>
|
||||
@if (rowArgs?.Item1.Expandable == true)
|
||||
{
|
||||
<a id="@(Grid.GridId() + Group.GetHashCode())" aria-label=@Grid.ExpandGroupAriaLabel @onclick:preventDefault="true" @onclick="@(_ => Grid.ExpandGroupItem(this, rowArgs?.Item1.Expanded))">
|
||||
<span class="@(Grid.ExpandedGroupItemStyle(this, Grid.allGroupsExpanded != null ? Grid.allGroupsExpanded : rowArgs?.Item1.Expanded))"></span>
|
||||
</a>
|
||||
}
|
||||
</td>
|
||||
}
|
||||
<td colspan="@(TotalColumnCount + (Grid?.Groups.Count ?? 0) - 1 - Group.Level + ((Grid?.Template != null && Grid?.ShowExpandColumn == true) ? 1 : 0))">
|
||||
|
||||
@@ -85,6 +85,8 @@
|
||||
{
|
||||
args.Expanded = allGroupsExpanded != null ? allGroupsExpanded : false;
|
||||
}
|
||||
|
||||
args.Expandable = args.Group.Data.Key != "Vice President, Sales";
|
||||
}
|
||||
|
||||
void OnGroupRowExpand(Group group)
|
||||
|
||||
Reference in New Issue
Block a user