Error in RadzenDropDown and RadzenDropDownGrid using Radzen 0.0.66

Hi,

I upgraded Radzen Blazor to 0.66 to be able to use RadzenDropDownGrid. After installing the update, the current RadzenDropDown does not work anymore.

If the dropdown is under ChildContent RadzenTemplateForm, it will have this error:

InvalidOperationException: Object of type 'Radzen.Blazor.RadzenDropDown' does not have a property matching the name 'ChildContent'.

If its outside, the dropdown will not bind contents and when clicked, will have this error on browser log console:

Uncaught ReferenceError: Radzen is not defined
at HTMLLabelElement.onclick (:2:1)
create-billing-cycle:1 Uncaught ReferenceError: Radzen is not defined
at HTMLDivElement.onfocusout

I think this also applies to RadzenDropDownGrid

Thanks

Not sure about the first error, here is a fresh app created from latest Radzen using 0.0.66

The second error means that most probably you are not using embedded scripts and styles. For example Radzen.Blazor.js:

<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>

CSS files can be referred like this:

HI,

So I fixed the second issue with adding the embedded script which was previously referring to a file path. The first issue still persist. From your sample, is that a RadzenTemplateForm? The issue I am having is on Blazor, we got this error if Dropdown or DropdownDataGrid is inside ChildCOntent from RadzenCard i.e.

                        <RadzenTemplateForm   
                            <ChildContent>
                                <RadzenCard>
                                    <ChildContent>

RadzenDropDown AllowClear="true" Data="@customerTypes" AllowFiltering="true" Name="CustomerTypeId" TextProperty="Type" ValueProperty="Id">




Yep, it is a RadzenTemplateForm:

<RadzenTemplateForm @ref="form0" @ref:suppressField Data="@(orderdetail)" Visible="@(orderdetail != null && canEdit)" TItem="OrderDetail" Submit="@Form0Submit">
  <ChildContent>
    <div style="margin-bottom: 1rem" class="row">
      <div class="col-md-3">
        <RadzenLabel @ref="label2" @ref:suppressField Text="Quantity" Component="Quantity" style="width: 100%">
        </RadzenLabel>
      </div>
      <div class="col-md-9">
        <RadzenNumeric @ref="quantity" @ref:suppressField style="display: block; width: 100%" Name="Quantity" TItem="int?">
        </RadzenNumeric>
        <RadzenRequiredValidator @ref="quantityRequiredValidator" @ref:suppressField Component="Quantity" Text="Quantity is required" style="position: absolute">
        </RadzenRequiredValidator>
      </div>
    </div>
    <div style="margin-bottom: 1rem" class="row">
      <div class="col-md-3">
        <RadzenLabel @ref="label3" @ref:suppressField Text="Order" Component="OrderId" style="width: 100%">
        </RadzenLabel>
      </div>
      <div class="col-md-9">
        <RadzenDropDownDataGrid @ref="orderId" @ref:suppressField Data="@(getOrdersForOrderIdResult)" TextProperty="UserName" ValueProperty="Id" Placeholder="Choose Order" style="width: 100%" Name="OrderId">
        </RadzenDropDownDataGrid>
      </div>
    </div>
    <div style="margin-bottom: 1rem" class="row">
      <div class="col-md-3">
        <RadzenLabel @ref="label4" @ref:suppressField Text="Product" Component="ProductId" style="width: 100%">
        </RadzenLabel>
      </div>
      <div class="col-md-9">
        <RadzenDropDownDataGrid @ref="productId" @ref:suppressField Data="@(getProductsForProductIdResult)" TextProperty="ProductName" ValueProperty="Id" Placeholder="Choose Product" style="width: 100%" Name="ProductId">
        </RadzenDropDownDataGrid>
      </div>
    </div>
    <div class="row">
      <div class="col offset-sm-3">
        <RadzenButton @ref="button2" @ref:suppressField ButtonType="submit" Icon="save" Text="Save" ButtonStyle="primary">
        </RadzenButton>
        <RadzenButton @ref="button3" @ref:suppressField ButtonStyle="light" Text="Cancel" Click="@Button3Click">
        </RadzenButton>
      </div>
    </div>
  </ChildContent>
</RadzenTemplateForm>

I've wrapped everything in RadzenCard and here is the result:

Hi,

FYI..I found the issue for this. Basically its because another radzen control is within my radzendropbox i.e <RadzenDropDown> <RadzenTextBox> </RadzenDropDown>

Thanks

1 Like