-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#705 [HxGridColumn] Parameter changes take effect after a roundtrip (…
…eg. changing Visible=true|false) - repro test
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@page "/HxGrid_Issue705_Test" | ||
|
||
<h3>HxGrid_Issue705_Test</h3> | ||
|
||
<HxSwitch @bind-Value="ShowAllColumns" Text="Show All Columns"></HxSwitch> | ||
|
||
<p>@ShowAllColumns</p> | ||
|
||
<HxGrid TItem="RowEntry" DataProvider="GetGridData"> | ||
<Columns> | ||
<HxGridColumn HeaderText="FirstColumn" ItemTextSelector="entry => entry.FirstColumn" Visible="ShowAllColumns"></HxGridColumn> | ||
<HxGridColumn HeaderText="SecondColumn" ItemTextSelector="entry => entry.SecondColumn"></HxGridColumn> | ||
<HxGridColumn HeaderText="ThirdColumn" ItemTextSelector="entry => entry.ThirdColumn" Visible="ShowAllColumns"></HxGridColumn> | ||
</Columns> | ||
</HxGrid> | ||
|
||
<HxGrid TItem="RowEntry" DataProvider="GetGridData"> | ||
<Columns> | ||
@if (ShowAllColumns) | ||
{ | ||
<HxGridColumn Order="1" HeaderText="FirstColumn" ItemTextSelector="entry => entry.FirstColumn"></HxGridColumn> | ||
} | ||
<HxGridColumn Order="2" HeaderText="SecondColumn" ItemTextSelector="entry => entry.SecondColumn"></HxGridColumn> | ||
@if (ShowAllColumns) | ||
{ | ||
<HxGridColumn Order="3" HeaderText="ThirdColumn" ItemTextSelector="entry => entry.ThirdColumn"></HxGridColumn> | ||
} | ||
</Columns> | ||
</HxGrid> | ||
|
||
@code { | ||
[Parameter] public bool ShowAllColumns { get; set; } | ||
|
||
private HxGrid<RowEntry> grid1; | ||
Check warning on line 34 in BlazorAppTest/Pages/HxGrid_Issue705_Test.razor
|
||
|
||
public record RowEntry(string FirstColumn, string SecondColumn, string ThirdColumn); | ||
|
||
private Task<GridDataProviderResult<RowEntry>> GetGridData(GridDataProviderRequest<RowEntry> request) | ||
{ | ||
return Task.FromResult(request.ApplyTo(new[] { | ||
new RowEntry("A1", "B1", "C1"), | ||
new RowEntry("A2", "B2", "C2"), | ||
new RowEntry("A3", "B3", "C3"), | ||
})); | ||
} | ||
} |