The property Expanded in GroupRowRenderEventArgs is always null. #462

Closed
opened 2026-01-29 17:37:43 +00:00 by claunia · 1 comment
Owner

Originally created by @OndrejUzovic on GitHub (Jul 10, 2022).

When the event GroupRowRenderEventArgs the property Expanded is always null, even if the row has already been expanded.
The problem is the property Expanded is not initialized when the event is being instantiated:

var args = new Radzen.GroupRowRenderEventArgs() { Group = item.Group, FirstRender = firstRender };

Would it be possible to update the code to set Expanded to true if it is expanded?

So the code in the responsible method would be:

internal Tuple<GroupRowRenderEventArgs, IReadOnlyDictionary<string, object>> GroupRowAttributes(RadzenDataGridGroupRow<TItem> item)
{
	var args = new Radzen.GroupRowRenderEventArgs()
	{
		Group = item.Group,
		FirstRender = firstRender,
		
		// Initialization of expanded
		Expanded = IsGroupItemExpanded(item)
	};

	if (GroupRowRender != null)
	{
		GroupRowRender(args);
	}

	return new Tuple<GroupRowRenderEventArgs, IReadOnlyDictionary<string, object>>(args, new System.Collections.ObjectModel.ReadOnlyDictionary<string, object>(args.Attributes));
}
Originally created by @OndrejUzovic on GitHub (Jul 10, 2022). When the event GroupRowRenderEventArgs the property Expanded is always null, even if the row has already been expanded. The problem is the property Expanded is not initialized when the event is being instantiated: `var args = new Radzen.GroupRowRenderEventArgs() { Group = item.Group, FirstRender = firstRender };` Would it be possible to update the code to set Expanded to true if it is expanded? So the code in the responsible method would be: ``` internal Tuple<GroupRowRenderEventArgs, IReadOnlyDictionary<string, object>> GroupRowAttributes(RadzenDataGridGroupRow<TItem> item) { var args = new Radzen.GroupRowRenderEventArgs() { Group = item.Group, FirstRender = firstRender, // Initialization of expanded Expanded = IsGroupItemExpanded(item) }; if (GroupRowRender != null) { GroupRowRender(args); } return new Tuple<GroupRowRenderEventArgs, IReadOnlyDictionary<string, object>>(args, new System.Collections.ObjectModel.ReadOnlyDictionary<string, object>(args.Attributes)); } ```
Author
Owner

@enchev commented on GitHub (Jul 14, 2022):

We cannot do that since you will unable to toggle expand state later at runtime.

@enchev commented on GitHub (Jul 14, 2022): We cannot do that since you will unable to toggle expand state later at runtime.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#462