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>
|
/// </summary>
|
||||||
public Group? Group { get; internal set; }
|
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>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this group row is expanded.
|
/// Gets or sets a value indicating whether this group row is expanded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -2510,7 +2510,7 @@ namespace Radzen.Blazor
|
|||||||
|
|
||||||
internal Tuple<GroupRowRenderEventArgs, IReadOnlyDictionary<string, object>> GroupRowAttributes(RadzenDataGridGroupRow<TItem> item)
|
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)
|
if (GroupRowRender != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,9 +26,12 @@
|
|||||||
}
|
}
|
||||||
<td class="rz-col-icon">
|
<td class="rz-col-icon">
|
||||||
<span class="rz-column-title"></span>
|
<span class="rz-column-title"></span>
|
||||||
<a id="@(Grid.GridId() + Group.GetHashCode())" aria-label=@Grid.ExpandGroupAriaLabel @onclick:preventDefault="true" @onclick="@(_ => Grid.ExpandGroupItem(this, rowArgs?.Item1.Expanded))">
|
@if (rowArgs?.Item1.Expandable == true)
|
||||||
<span class="@(Grid.ExpandedGroupItemStyle(this, Grid.allGroupsExpanded != null ? Grid.allGroupsExpanded : rowArgs?.Item1.Expanded))"></span>
|
{
|
||||||
</a>
|
<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>
|
||||||
}
|
}
|
||||||
<td colspan="@(TotalColumnCount + (Grid?.Groups.Count ?? 0) - 1 - Group.Level + ((Grid?.Template != null && Grid?.ShowExpandColumn == true) ? 1 : 0))">
|
<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.Expanded = allGroupsExpanded != null ? allGroupsExpanded : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args.Expandable = args.Group.Data.Key != "Vice President, Sales";
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnGroupRowExpand(Group group)
|
void OnGroupRowExpand(Group group)
|
||||||
|
|||||||
Reference in New Issue
Block a user