I have a DataGrid setup as per the Hierarchy example where drilling down with the arrowhead on the left side expands beneath the row. This detail sections also contains a DataGrid with filtering using a drop down list.
Once I click the expand arrow it's locked and doesn't compress unless I expand another row. Is it possible to make it collapsible by clicking it again?
Every time I select an option on the nested grid it resets the view of the whole pages compressing everything and I have to re-expand the outer grid's row again.Can it be set to not collapse?
The first question was actually a bug (item cannot be collapsed in single ExpandMode) - already fixed. I’m not sure about your second question. Can you provide more info, screenshot, code example?
Figured I'd add my own affirmation of a bug/issue with the grid behavior since it appears to be a similar problem.
I am having a similar issue with the DataGrid. I am using a hierarchy model as well. The main grid, when it expands a row, templates a RadzenCard followed immediately by a RadzenTabs containing 3 RadzenTabItems. One of the RadzenTabItems contains another DataGrid, and expanding a row in this grid templates another card and set of tabs.
Both grids are set up for inline editing and the elements in the tabs when rows are expanded are editable as well when the corresponding grid row is edited. Everything works fine on the outer grid, the row remains open during editing, however, the inner subgrid collapses the row when any edit is done to controls either in the grid row or in the tabs which are present in the expanded row.
I need the grids to keep their rows open during edit as well.
Please note, I did get the 2.11.17 NuGet package update which corrected the first issue you listed, but I see now that there is an update for version 2.12.1. I intend to update and see if the issue has been corrected.
UPDATE:
I downloaded the 2.12.1 NuGet package and, from my initial testing, it appears that the behavior has been corrected. You might wish to upgrade to the latest version to see if this handles your particular issue as well.
I have NuGet package version 3.2.3 and using the ExpandMode="DataGridExpandMode.Single" on my datagrid. When I click the carrot the row expands. When I click the carrot again, the row is not collapsing. Is this a bug or am I doing something wrong?
Here is the code for the pertinent section:
<RadzenGrid @ref="portfolioGrid" AllowFiltering="true" AllowPaging="true" AllowSorting="true" PageSize="10" ExpandMode="DataGridExpandMode.Single"
FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" Data="@filteredLoans" TItem="LenderPortfolio" ColumnWidth="100px">
I'm having the same problem on 3.2.6.
I ended up having to bind to the RowExpand and RowCollapse events. The RowCollapse gets raised if a row gets open (the same row or a different row)
When you click the same row that is already expanded
Collapsed gets raised
then
Expand gets raised
Once expand gets raised, you check to see if
--. A collapse was just called and
-- If it was the same row. If so, then reset the grid ( gridObj.Reset(false, true) )
int expandedTeamId = 0;
bool recentCollapse = false;
void RowSelect(Team team)
{
//workaround to close row, as there is a current bug in radzen
//If we did not select the same row, continue as normal
if (!recentCollapse || team.Id != expandedTeamId)
{
//fetch data
//.........
expandedTeamId = team.Id
}
else
{
teamsGrid.Reset(false, true);
recentCollapse = false;
}
}
void RowCollapse(Team team)
{
recentCollapse = true;
}
Might be an easier way... but this works for me until a fix is in place