I have a blazor server page that starts with a
<div class="rz-p-12 rz-text-align-center">
<RadzenDropDown TValue="string" Value="CalendarPeriod2.Select( p => p.GlPeriodOracle).First()" Data=@CalendarPeriod2.Select( p => p.GlPeriodOracle) />
</div>
@code
{
public IEnumerable<CalendarPeriod> CalendarPeriod2 { get; set; } = null!;
protected override async Task OnParametersSetAsync()
{
CalendarPeriod2 = await _db.GetCalendarPeriod2Async();
ProjectWipCalculations = await _db.GetCurrentMonthWIPData(projectList, CalendarPeriod2.PeriodFrom);
}
and this is the CalendarPeriod2:
public class CalendarPeriod2
{
public int? Period { get; set; }
public DateTime PeriodFrom { get; set; }
public DateTime PeriodTo { get; set; }
public string GlPeriodOracle { get; } = null!;
public string GlPeriodCalendar { get; set; } = null!;
}
and then has some other methods that use the data on the CalendarPeriod item.
however, what I want is to have the page render the first time with a value that is calculated for the CalendarPeriod (CalendarPeriod2.PeriodFrom)
but when the user selects the dropdown for another item, I want to recalculate the "ProjectWipCalculations " with the new parameter for CalendarPeriod2.PeriodFrom. how can I do this? I'm struggling to get the parameter to be passed properly when selected in the dropdown (it's a radzen component) and then I want that when is changed, to be basically "re-run" the page with the new selected parameter.
I know this can be done, but I can't find an example of this behaviour to understand how to do it