Hello
I am interested in Blazor and Radzen. I am looking for to understand if is possible to create dinamically form using Bladzor + Radzen. I mean display controls in a form/popup based on some configuration or user selection.
Thanks
Regards
Hello
I am interested in Blazor and Radzen. I am looking for to understand if is possible to create dinamically form using Bladzor + Radzen. I mean display controls in a form/popup based on some configuration or user selection.
Thanks
Regards
Hi,
You can make dynamic forms using razor pages and radzen components.
Thanks!
I am new on this environment and supposing was possible. I am trying to implement and probably understood how do it.
It depends on exactly what you are trying to acheive. for example I needed to create a form dynamically where in I had stored the type of control, name of control ,default values etc in controlslist. I could acheive it as below. This .razor code will not work directly but will give you some idea how to go about it.
@if (ControlsList!=null)
@foreach (var control in ControlsList)
{
<div class="row">
<div class="col-md-2">
<RadzenLabel style="width: 100%" Text=@(control.Label) Visible=@((bool)control.Enable)>
</RadzenLabel>
</div>
@switch (control.Control)
{
case "TextBox":
<div class="col-xl-3">
<RadzenTextBox Placeholder=@(control.Label!=""?control.Label:control.Reportparameterfield) style="width: 100%" @bind-Value="@(ParaValues[control.Reportparameterfield])" Visible=@((bool)control.Enable) >
</RadzenTextBox>
</div>
break;
case "DropDown" :
@if (control.Data!="")
{
<div class="col-xl-3">
<RadzenDropDown AllowClear="true" AllowFiltering="true" Data="@GetSqlData(control.Data,control.Control)" TextProperty="Description" ValueProperty="Code" Placeholder=@(control.Label) style="width: 100%" @bind-Value="@(ParaValues[control.Reportparameterfield])" >
</RadzenDropDown>
</div>
}
break;
case "DateTimePicker":
<div class="col-xl-3">
<RadzenDatePicker AllowClear="true" DateFormat="dd-MM-yyyy" Placeholder=@(control.Label!=""?control.Label:control.Reportparameterfield) style="width: 100%" TValue="DateTime" Change="@(a => OnDateValueChange(a, control.Reportparameterfield))" >
</RadzenDatePicker>
</div>
break;
}
</div>
}
Thanks a lot Vinod.
This was my first idea but looking for something using render methods.
Regards